12 FILLVEC3(m_world_bounding_box.Min(), 888888.8);
13 FILLVEC3(m_world_bounding_box.Max(), -888888.8);
14 ZEROVEC3(m_world_bounding_sphere.Center());
15 m_world_bounding_sphere.Radius() = 0.0;
20 ToggleUnknown0xd8(
TRUE);
36 double local2world[4][4];
37 double local2parent[4][4];
40 for (i = 0; i < 4; i++) {
41 for (j = 0; j < 4; j++) {
42 local2world[i][j] = p_transform[i][j];
47 double local_inverse[4][4];
50 double parent2world[4][4];
51 MXM4(parent2world, local_inverse, local2world);
54 for (k = 0; k < 4; k++) {
55 for (l = 0; l < 4; l++) {
56 mat[k][l] = parent2world[k][l];
77 double local2parent[4][4];
80 for (i = 0; i < 4; i++) {
81 for (j = 0; j < 4; j++) {
86 double local_inverse[4][4];
89 for (i = 0; i < 4; i++) {
90 for (j = 0; j < 4; j++) {
91 mat[i][j] = local_inverse[i][j];
144 for (CompoundObject::iterator iter =
comp->begin(); !(iter ==
comp->end()); iter++) {
177 world_bounding_sphere.
Radius() = modelling_sphere.
Radius();
180 world_bounding_box.
Min()[0] = world_bounding_sphere.
Center()[0] - world_bounding_sphere.
Radius();
181 world_bounding_box.
Min()[1] = world_bounding_sphere.
Center()[1] - world_bounding_sphere.
Radius();
182 world_bounding_box.
Min()[2] = world_bounding_sphere.
Center()[2] - world_bounding_sphere.
Radius();
183 world_bounding_box.
Max()[0] = world_bounding_sphere.
Center()[0] + world_bounding_sphere.
Radius();
184 world_bounding_box.
Max()[1] = world_bounding_sphere.
Center()[1] + world_bounding_sphere.
Radius();
185 world_bounding_box.
Max()[2] = world_bounding_sphere.
Center()[2] + world_bounding_sphere.
Radius();
[AI] Represents an axis-aligned bounding box in 3D space, using minimum and maximum points.
const Vector3 & Min() const
[AI] Const accessor for the minimum corner of the bounding box.
const Vector3 & Max() const
[AI] Const accessor for the maximum corner of the bounding box.
[AI] Represents a bounding sphere in 3D space with center and radius.
const float & Radius() const
[AI] Const accessor for the sphere radius.
const Vector3 & Center() const
[AI] Const accessor for the center of the sphere.
4x4 Matrix class with virtual interface for manipulation and transformation.
virtual void Product(float(*p_a)[4], float(*p_b)[4])
Multiplies two 4x4 float matrices, storing result in this.
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
[AI] Represents an ROI (Real-time Object Instance) that can be oriented in world space,...
const BoundingSphere & GetWorldBoundingSphere() const override
Returns the object's bounding sphere in world coordinates.
BoundingBox m_world_bounding_box
The object's axis-aligned bounding box in world space, recalculated as needed.
virtual void SetLocalTransform(const Matrix4 &p_transform)
Sets the local-to-world transformation matrix directly.
const Matrix4 & GetLocal2World() const
Accessor for the current local-to-world transformation matrix.
virtual void UpdateWorldVelocity()
Updates the world velocity (must be implemented by subclasses if custom velocity logic is needed).
void WrappedSetLocalTransform(const Matrix4 &p_transform)
Wraps SetLocalTransform, for possible override or interface uniformity.
virtual void VTable0x1c()
[AI] Concrete subclass implementation should implement this to perform post-bounding-volume-change lo...
Mx3DPointFloat m_world_velocity
The object's velocity vector in world coordinates.
void FUN_100a5a30(const Vector3 &p_world_velocity)
Sets the world velocity to the provided vector.
const float * GetWorldVelocity() const override
Returns a pointer to the object's velocity vector in world space.
MxMatrix m_local2world
The transform from local to world space; 4x4 transformation matrix.
void GetLocalTransform(Matrix4 &p_transform)
Retrieves the local-to-world transformation, or if there is a parent, computes the transform relative...
virtual void VTable0x24(const Matrix4 &p_transform)
Post-multiplies the current local-to-world matrix by p_transform.
void WrappedVTable0x24(const Matrix4 &p_transform)
Wraps VTable0x24, possibly for decoupling or uniform invocation.
void FUN_100a58f0(const Matrix4 &p_transform)
Assigns the given matrix as the local-to-world transformation and enables some internal flags.
OrientableROI * m_parentROI
If non-null, points to the parent OrientableROI for local/world transformation hierarchy.
virtual void UpdateWorldBoundingVolumes()=0
Recalculates all world bounding volumes from the current local-to-world transform.
void UpdateTransformationRelativeToParent(const Matrix4 &p_transform)
Calculates and updates the world transform relative to this object's parent, then calls UpdateWorldDa...
const BoundingBox & GetWorldBoundingBox() const override
Returns the object's bounding box in world coordinates.
BoundingSphere m_world_bounding_sphere
The object's bounding sphere in world space, recalculated from m_local2world.
void ToggleUnknown0xd8(BOOL p_enable)
Enables or disables some bitfields in the internal unknown status variable m_unk0xd8.
virtual void UpdateWorldData(const Matrix4 &p_transform)
Applies p_transform in (presumably) parent coordinates and updates world data for self and children.
[AI] Abstract base class for Real-time Object Instances (ROI) in the world.
CompoundObject * comp
[AI] List of sub-ROIs composing this ROI (compound object), or NULL. [AI]
virtual float * GetData()
[AI] Retrieves the mutable in-memory data pointer for this vector.
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
void CalcWorldBoundingVolumes(const BoundingSphere &modelling_sphere, const Matrix4 &local2world, BoundingBox &world_bounding_box, BoundingSphere &world_bounding_sphere)
[AI] Computes the world-space bounding box and bounding sphere for an ROI using a modeling sphere and...
#define V3XM4(to3, v3, m4)
#define INVERTMAT4d(to, from)