Class: Box2D::DebugDraw
- Inherits:
-
Object
- Object
- Box2D::DebugDraw
- Defined in:
- lib/box2d/debug_draw.rb
Constant Summary collapse
- FLAG_FIELDS =
{ shapes: :drawShapes, joints: :drawJoints, joint_extras: :drawJointExtras, aabbs: :drawBounds, bounds: :drawBounds, mass: :drawMass, body_names: :drawBodyNames, contacts: :drawContacts, graph_colors: :drawGraphColors, contact_normals: :drawContactNormals, contact_impulses: :drawContactImpulses, contact_features: :drawContactFeatures, friction_impulses: :drawFrictionImpulses, islands: :drawIslands }.freeze
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
Instance Method Summary collapse
-
#initialize(flags, &block) ⇒ DebugDraw
constructor
A new instance of DebugDraw.
- #raise_callback_error ⇒ Object
Constructor Details
#initialize(flags, &block) ⇒ DebugDraw
Returns a new instance of DebugDraw.
24 25 26 27 28 29 30 31 |
# File 'lib/box2d/debug_draw.rb', line 24 def initialize(flags, &block) @block = block @error = nil @definition = Native.b2DefaultDebugDraw @callbacks = [] configure_flags(flags) configure_callbacks end |
Instance Attribute Details
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
22 23 24 |
# File 'lib/box2d/debug_draw.rb', line 22 def callbacks @callbacks end |
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
22 23 24 |
# File 'lib/box2d/debug_draw.rb', line 22 def definition @definition end |
Instance Method Details
#raise_callback_error ⇒ Object
33 34 35 |
# File 'lib/box2d/debug_draw.rb', line 33 def raise_callback_error raise @error if @error end |