Macro three::three_object

source ·
macro_rules! three_object {
    ($name:ident::$field:ident) => { ... };
    ($name:ident) => { ... };
}
Expand description

Implements the following traits:

  • AsRef<object::Base>
  • AsMut<object::Base>
  • Object

Examples

Creating a wrapper around a named field.

#[macro_use]
extern crate three;

three_object!(MyStruct::mesh);
struct MyStruct {
    mesh: three::Mesh,
}

If the field parameter is omitted then the field name defaults to object.

#[macro_use]
extern crate three;

// Equivalent to `three_object!(MyStruct::object);`
three_object!(MyStruct);
struct MyStruct {
    object: three::Mesh,
}