mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Fixed always adding a new node to AABBTree when updating a node.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
class IMICFPS
|
||||
class AABBTree
|
||||
class AABBNode
|
||||
attr_accessor :bounding_box, :parent, :object, :a, :b
|
||||
attr_accessor :bounding_box, :parent, :object
|
||||
attr_reader :a, :b
|
||||
def initialize(parent:, object:, bounding_box:)
|
||||
@parent = parent
|
||||
@object = object
|
||||
@@ -11,6 +12,16 @@ class IMICFPS
|
||||
@b = nil
|
||||
end
|
||||
|
||||
def a=(leaf)
|
||||
@a = leaf
|
||||
@a.parent = self
|
||||
end
|
||||
|
||||
def b=(leaf)
|
||||
@b = leaf
|
||||
@b.parent = self
|
||||
end
|
||||
|
||||
def leaf?
|
||||
@object
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user