Created
May 21, 2018 13:07
-
-
Save kooparse/4c47a930c03a820cd12b508e1e572429 to your computer and use it in GitHub Desktop.
Fuel API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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