24static int32_t
Math_DotProduct3Q12(int32_t ax, int32_t ay, int32_t az, int32_t bx, int32_t by, int32_t bz)
26 uint64_t sum = (uint64_t)((int64_t)ax * bx) + (uint64_t)((int64_t)ay * by) + (uint64_t)((int64_t)az * bz);
56 if (distance > ((uint32_t)(radius * radius) >> 2) ||
79 int32_t
y = projected.
y;
102 }
while (--remaining);
113 int32_t selected_object_list = object_list_index;
115 if (selected_object_list == 2)
123 selected_object_list = 1;
131 node_actor = node_actor->list_next)
144 int32_t swept_bounding_diameter = swept_bounding_radius * 2;
163 int16_t *rotation_column = &other_actor->
rot_mat.
m10;
164 int32_t relative_z = relative_z_before_motion + other_actor->
sub_pos.
z;
165 int32_t axis_index = 0;
167 int16_t *next_rotation_column = rotation_column;
171 int32_t m10 = (int32_t)rotation_column[0];
172 int32_t axis_half_extent;
174 m00 = (int32_t)rotation_column[-3];
177 int32_t m20 = (int32_t)rotation_column[3];
178 int32_t expanded_extent_or_corner_z = (axis_half_extent << 6) + collision_radius_q12;
180 if ((uint32_t)
Math_DotProduct3Q12(relative_x, relative_y, relative_z, m00, m10, m20) + (uint32_t)expanded_extent_or_corner_z > (uint32_t)expanded_extent_or_corner_z * 2u)
183 int32_t packed_corner_xy = 0;
185 for (int32_t i = 0; i < 4;)
191 (*(uint16_t *)&packed_corner_xy) = -(other_actor->
visual_scale.
x);
192 *(uint16_t *)((
char *)&packed_corner_xy + 2) = -(other_actor->
visual_scale.
y);
193 (*(uint16_t *)&expanded_extent_or_corner_z) = -(int16_t)(uintptr_t)other_actor->
mesh_polygon_array;
200 (*(uint16_t *)&expanded_extent_or_corner_z) = (uint16_t)(uintptr_t)(other_actor->
mesh_polygon_array);
207 *(uint16_t *)((
char *)&packed_corner_xy + 2) = other_actor->
visual_scale.
y;
214 (*(uint16_t *)&expanded_extent_or_corner_z) = -(int16_t)(uintptr_t)other_actor->
mesh_polygon_array;
220 *(uint32_t *)&vertices[i] = packed_corner_xy;
221 vertices[i].
pos.
z = (int16_t)expanded_extent_or_corner_z;
223 int32_t opposite_vertex_byte_offset = (i - ((i & 1) << 1) + 5) * 0xc;
225 vertices[i - ((i & 1) << 1) + 5].
pos.
x = (int16_t)-(packed_corner_xy);
227 vertices[opposite_vertex_byte_offset / 12].
pos.
y = -(int16_t)(packed_corner_xy >> 16);
228 vertices[opposite_vertex_byte_offset / 12].
pos.
z = -(int16_t)expanded_extent_or_corner_z;
231 for (int32_t extent_axis_index = 0; extent_axis_index < 3; extent_axis_index++)
245 bool has_more_axes = axis_index + 1 < 3;
248 next_rotation_column = &next_rotation_column[1];
253 rotation_column = next_rotation_column;
#define ACTOR_LIFECYCLE_DISABLED
#define ACTOR_BEHAVIOR_WORKLIST_MEMBER
#define ACTOR_BEHAVIOR_MOVEMENT_ACTIVE
#define ACTOR_LIFECYCLE_FORCE_HIDDEN
#define Actor_DefaultUpdateCallbackSlot
#define COLLISION_POLYGON_GROUND_EXCLUSION_LOW
#define COLLISION_NODE_CULL_DISABLED
#define COLLISION_NODE_SKIP_POLYGON_QUERY
#define COLLISION_NODE_SKIP_GROUND_QUERY
#define COLLISION_CALLBACK_DAMAGE_PROBE
#define COLLISION_GROUND_HEIGHT_TOLERANCE_Q6
#define COLLISION_NODE_COLLIDABLE
#define COLLISION_NODE_CULL_FORCE_HIDDEN
@ COLLISION_NODE_ORIENTED_BOX
#define COLLISION_ATTACHMENT_SKIP_ACTOR_SCAN
void Collision_ProjectPointOntoPolygonSurface(struct Collision_Node const *collision_node, struct Collision_Polygon const *contact_poly, struct Math_Vec3I32 const *world_pos, struct Math_Vec3I32 *out_world_pos)
int32_t Collision_GetShapeRadiusQ12(const struct Actor_CollisionShapeNodeView *shape)
void Collision_DetectAndResolve3DCollision(struct Actor_State *actor, struct Collision_Node *collision_source, struct Collision_Vertex *vertices, struct Collision_Polygon *polygons, int32_t polygon_count)
int32_t Collision_IsPointInsidePolygon(struct Collision_Node const *collision_node, struct Collision_Polygon const *polygon, int16_t point_x, int16_t point_z)
uint8_t Collision_TestLineSphereIntersection(struct Math_Vec3I32 *line_start, struct Math_Vec3I32 *segment_delta, uint32_t sphere_radius)
#define g_collisionTestRadiusQ6
#define g_collisionResponseBuffer
#define Collision_BoxFacePolygons
#define g_collisionTestMotionXQ12
#define g_collisionTestPosZ
#define g_collisionTestPosX
#define g_collisionTestMotionZQ12
#define g_collisionTestPosY
#define g_collisionTestMotionYQ12
#define ENTITY_FLAG_ACTOR_COLLISION_SCAN
int32_t Math_ApproxDistance3DWeighted(int32_t dx, int32_t dy, int32_t dz)
void Collision_DetectObjectNodeCollisions(struct Actor_State *actor, int32_t object_list_index)
void Collision_DetectDynamicObject(struct Actor_State *actor, int32_t *in_out_ground_y)
static int32_t Math_DotProduct3Q12(int32_t ax, int32_t ay, int32_t az, int32_t bx, int32_t by, int32_t bz)
void Collision_ResolveObjectNodeCollision(struct Actor_State *actor, struct Actor_State *other_actor)
#define pkg_resource_current_level_data
struct Component_Instance * collision_component_or_parent_component
struct Collision_Polygon * ground_contact_polygon
struct Collision_Node * ground_collision_node
struct Math_Vec2I16 visual_scale
struct Mesh_Polygon * mesh_polygon_array
struct Math_Vec3I32 sub_pos
struct Math_Matrix3x3I16 rot_mat
struct Math_Vec3I32 position
struct Collision_Vertex * vertices
struct Collision_Polygon * polygons
struct Math_Vec3I32 origin
struct Collision_Node * next_in_list
struct Collision_Vertex::@111126275124057154070202104324102117233165176236::@061322026074334072070347216127267241215241121036 pos