|
@@ -20,27 +20,27 @@ void PyBody::_register(VM* vm, PyObject* mod, PyObject* type){
|
|
|
return obj;
|
|
return obj;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "type: int", _b2Body, GetType, SetType)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "gravity_scale: float", _b2Body, GetGravityScale, SetGravityScale)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "fixed_rotation: bool", _b2Body, IsFixedRotation, SetFixedRotation)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "enabled: bool", _b2Body, IsEnabled, SetEnabled)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "bullet: bool", _b2Body, IsBullet, SetBullet)
|
|
|
|
|
|
|
+ PY_PROPERTY(PyBody, "type: int", _b2Body, GetType, SetType)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "gravity_scale: float", _b2Body, GetGravityScale, SetGravityScale)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "fixed_rotation: bool", _b2Body, IsFixedRotation, SetFixedRotation)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "enabled: bool", _b2Body, IsEnabled, SetEnabled)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "bullet: bool", _b2Body, IsBullet, SetBullet)
|
|
|
|
|
|
|
|
- PK_REGISTER_READONLY_PROPERTY(PyBody, "mass: float", _b2Body, GetMass)
|
|
|
|
|
- PK_REGISTER_READONLY_PROPERTY(PyBody, "inertia: float", _b2Body, GetInertia)
|
|
|
|
|
|
|
+ PY_READONLY_PROPERTY(PyBody, "mass: float", _b2Body, GetMass)
|
|
|
|
|
+ PY_READONLY_PROPERTY(PyBody, "inertia: float", _b2Body, GetInertia)
|
|
|
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "position: vec2", _, get_position, set_position)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "rotation: float", _, get_rotation, set_rotation)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "velocity: vec2", _, get_velocity, set_velocity)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "angular_velocity: float", _b2Body, GetAngularVelocity, SetAngularVelocity)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "damping: float", _b2Body, GetLinearDamping, SetLinearDamping)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "angular_damping: float", _b2Body, GetAngularDamping, SetAngularDamping)
|
|
|
|
|
|
|
+ PY_PROPERTY(PyBody, "position: vec2", _, get_position, set_position)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "rotation: float", _, get_rotation, set_rotation)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "velocity: vec2", _, get_velocity, set_velocity)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "angular_velocity: float", _b2Body, GetAngularVelocity, SetAngularVelocity)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "damping: float", _b2Body, GetLinearDamping, SetLinearDamping)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "angular_damping: float", _b2Body, GetAngularDamping, SetAngularDamping)
|
|
|
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "density: float", _b2Fixture, GetDensity, SetDensity)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "friction: float", _b2Fixture, GetFriction, SetFriction)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "restitution: float", _b2Fixture, GetRestitution, SetRestitution)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "restitution_threshold: float", _b2Fixture, GetRestitutionThreshold, SetRestitutionThreshold)
|
|
|
|
|
- PK_REGISTER_PROPERTY(PyBody, "is_sensor: bool", _b2Fixture, IsSensor, SetSensor)
|
|
|
|
|
|
|
+ PY_PROPERTY(PyBody, "density: float", _b2Fixture, GetDensity, SetDensity)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "friction: float", _b2Fixture, GetFriction, SetFriction)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "restitution: float", _b2Fixture, GetRestitution, SetRestitution)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "restitution_threshold: float", _b2Fixture, GetRestitutionThreshold, SetRestitutionThreshold)
|
|
|
|
|
+ PY_PROPERTY(PyBody, "is_sensor: bool", _b2Fixture, IsSensor, SetSensor)
|
|
|
|
|
|
|
|
vm->bind(type, "set_box_shape(self, hx: float, hy: float)",
|
|
vm->bind(type, "set_box_shape(self, hx: float, hy: float)",
|
|
|
[](VM* vm, ArgsView args){
|
|
[](VM* vm, ArgsView args){
|