Module: CP::Constraint
- Included in:
- DampedRotarySpring, DampedSpring, GearJoint, GrooveJoint, PinJoint, PivotJoint, RatchetJoint, RotaryLimitJoint, SimpleMotor, SlideJoint
- Defined in:
- lib/chipmunk-ffi/constraint.rb
Constant Summary collapse
- PinJoint =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::PinJoint
- GearJoint =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::GearJoint
- PivotJoint =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::PivotJoint
- SlideJoint =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::SlideJoint
- GrooveJoint =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::GrooveJoint
- SimpleMotor =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::SimpleMotor
- DampedSpring =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::DampedSpring
- RatchetJoint =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::RatchetJoint
- RotaryLimitJoint =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::RotaryLimitJoint
- DampedRotarySpring =
Alias for compatibility with chipmunk C-Ruby bindings.
CP::DampedRotarySpring
Instance Attribute Summary collapse
-
#body_a ⇒ Object
readonly
Returns the value of attribute body_a.
-
#body_b ⇒ Object
readonly
Returns the value of attribute body_b.
-
#struct ⇒ Object
readonly
Returns the value of attribute struct.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#body_a ⇒ Object (readonly)
Returns the value of attribute body_a.
25 26 27 |
# File 'lib/chipmunk-ffi/constraint.rb', line 25 def body_a @body_a end |
#body_b ⇒ Object (readonly)
Returns the value of attribute body_b.
25 26 27 |
# File 'lib/chipmunk-ffi/constraint.rb', line 25 def body_b @body_b end |
#struct ⇒ Object (readonly)
Returns the value of attribute struct.
25 26 27 |
# File 'lib/chipmunk-ffi/constraint.rb', line 25 def struct @struct end |
Class Method Details
.included(other) ⇒ Object
31 32 33 34 |
# File 'lib/chipmunk-ffi/constraint.rb', line 31 def self.included(other) super other.class_eval { extend StructAccessor } end |
Instance Method Details
#set_data_pointer ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/chipmunk-ffi/constraint.rb', line 36 def set_data_pointer mem = FFI::MemoryPointer.new(:long) mem.put_long 0, object_id # this is needed to prevent data corruption by GC @constraint_pointer = mem @struct.constraint.data = mem end |