Skip to content

Instantly share code, notes, and snippets.

@kooparse
Created May 21, 2018 13:07
Show Gist options
  • Save kooparse/4c47a930c03a820cd12b508e1e572429 to your computer and use it in GitHub Desktop.
Save kooparse/4c47a930c03a820cd12b508e1e572429 to your computer and use it in GitHub Desktop.
Fuel API
extern crate fuel;
use fuel::{Scene, Light}
fn main() {
// Create my scene
let scene = scene::new();
// Create my lamp object
let lamp = Light::new();
// I move the lamp object inside my scene
// and i get the object id where the object is
// located in the hashmap.
let object_id = scene.add(lamp);
// I have my lamp back
let lamp = scene.get_object(id);
// I can call every func from the SceneObject trait.
lamp.set_position(0., 0., 0.);
lamp.hide();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment