Macro pasture_core::attributes_mut[][src]

macro_rules! attributes_mut {
    ($attr1:expr => $t1:ty, $attr2:expr => $t2:ty, $buffer:expr) => { ... };
    ($attr1:expr => $t1:ty, $attr2:expr => $t2:ty, $attr3:expr => $t3:ty, $buffer:expr) => { ... };
    ($attr1:expr => $t1:ty, $attr2:expr => $t2:ty, $attr3:expr => $t3:ty, $attr4:expr => $t4:ty, $buffer:expr) => { ... };
}

Create an iterator over mutable references to multiple attributes within a PointBuffer. Requires that the buffer implements PerAttributePointBufferMut. This macro uses some special syntax to determine the attributes and their types:

attributes_mut!{ ATTRIBUTE_1_EXPR => ATTRIBUTE_1_TYPE, ATTRIBUTE_2_EXPR => ATTRIBUTE_2_TYPE, ..., buffer }

ATTRIBUTE_X_EXPR must be an expression that evaluates to a &PointAttributeDefinition and ATTRIBUTE_X_TYPE must be the Pasture PrimitiveType that the attribute reference will be returned as. The type must match the type that the attribute is stored with in the buffer. The iterator will then return tuples of the form:

(&mut ATTRIBUTE_1_TYPE, &mut ATTRIBUTE_2_TYPE, ...)

Note: Currently, a maximum of 4 attributes at the same time are supported.

Panics

Panics if any of the attributes are not contained within the buffer. Panics if, for any attribute, the desired type does not match the PointAttributeDataType of that attribute.