Crates.io | specs_transform |
lib.rs | specs_transform |
version | 0.5.0 |
source | src |
created_at | 2017-10-13 20:41:05.957922 |
updated_at | 2019-07-05 22:45:05.570867 |
description | transform 2d and 3d component for specs |
homepage | https://gitlab.com/nathanfaucett/rs-specs_transform |
repository | https://gitlab.com/nathanfaucett/rs-specs_transform.git |
max_upload_size | |
id | 35543 |
size | 41,005 |
transform 2d and 3d component for specs
extern crate specs;
extern crate specs_bundler;
extern crate specs_transform;
use specs::{World, DispatcherBuilder};
use specs_bundler::Bundler;
use specs_transform::{TransformBundle, Parent, Transform3D, , Transform2D};
fn main() {
let mut world = World::new();
let mut dispatcher = Bundler::new(&mut world, DispatcherBuilder::new())
.bundle(TransformBundle::<f32>::default()).unwrap()
.build();
let parent = world.create_entity()
.with(Transform3D::<f32>::default())
.build();
let child = world.create_entity()
.with(Parent::new(parent))
.with(Transform2D::<f32>::default())
.build();
let _grandchild = world.create_entity()
.with(Parent::new(child))
.with(Transform3D::<f32>::default())
.build();
dispatcher.dispatch(&mut world.res);
}