Class: Jolt::Layers::NativeResources
- Inherits:
-
Object
- Object
- Jolt::Layers::NativeResources
- Defined in:
- lib/jolt/layers.rb
Instance Attribute Summary collapse
-
#broad_phase_interface ⇒ Object
readonly
Returns the value of attribute broad_phase_interface.
-
#object_pair_filter ⇒ Object
readonly
Returns the value of attribute object_pair_filter.
-
#object_vs_broad_phase_filter ⇒ Object
readonly
Returns the value of attribute object_vs_broad_phase_filter.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(layers, mappings, collisions) ⇒ NativeResources
constructor
A new instance of NativeResources.
- #transfer_to_system! ⇒ Object
Constructor Details
#initialize(layers, mappings, collisions) ⇒ NativeResources
Returns a new instance of NativeResources.
120 121 122 123 124 125 126 |
# File 'lib/jolt/layers.rb', line 120 def initialize(layers, mappings, collisions) @destroyed = false create_filters(layers, mappings, collisions) rescue StandardError destroy raise end |
Instance Attribute Details
#broad_phase_interface ⇒ Object (readonly)
Returns the value of attribute broad_phase_interface.
118 119 120 |
# File 'lib/jolt/layers.rb', line 118 def broad_phase_interface @broad_phase_interface end |
#object_pair_filter ⇒ Object (readonly)
Returns the value of attribute object_pair_filter.
118 119 120 |
# File 'lib/jolt/layers.rb', line 118 def object_pair_filter @object_pair_filter end |
#object_vs_broad_phase_filter ⇒ Object (readonly)
Returns the value of attribute object_vs_broad_phase_filter.
118 119 120 |
# File 'lib/jolt/layers.rb', line 118 def object_vs_broad_phase_filter @object_vs_broad_phase_filter end |
Instance Method Details
#destroy ⇒ Object
128 129 130 131 132 133 134 135 |
# File 'lib/jolt/layers.rb', line 128 def destroy return if @destroyed Native.JPH_ObjectVsBroadPhaseLayerFilter_Destroy(@object_vs_broad_phase_filter) if present?(@object_vs_broad_phase_filter) Native.JPH_ObjectLayerPairFilter_Destroy(@object_pair_filter) if present?(@object_pair_filter) Native.JPH_BroadPhaseLayerInterface_Destroy(@broad_phase_interface) if present?(@broad_phase_interface) @destroyed = true end |
#transfer_to_system! ⇒ Object
137 138 139 |
# File 'lib/jolt/layers.rb', line 137 def transfer_to_system! @destroyed = true end |