Object3D.Implement

Add a basic implementation for the position as a property, includes a setter.

Members

Functions

position
const(Position) position()

Get the current position of the object.

position
Position position(Position value)

Set the new position.

positionRef
Position positionRef()

Get a reference to the position value.

visualPosition
const(Position) visualPosition()

Get the current position of the object.

Examples

class Example : Object3D {

    mixin Object3D.Implement;

    this() {
        super(null);
    }

}

auto ex = new Example;
assert(ex.position == .position(0, 0));

ex.positionRef.x += 1;
assert(ex.position == .position(1, 0));

ex.position = .position(2, 2);
assert(ex.position == .position(2, 2));

Meta