Skip to content

Commit

Permalink
Use paired singles for object collision transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
malleoz committed Dec 29, 2024
1 parent f64900d commit 0094662
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/game/field/ObjectCollisionConvexHull.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ void ObjectCollisionConvexHull::transform(const EGG::Matrix34f &mat, const EGG::

if (scale.x == 0.0f) {
for (size_t i = 0; i < m_points.size(); ++i) {
m_worldPoints[i] = mat.multVector(m_points[i]);
m_worldPoints[i] = mat.ps_multVector(m_points[i]);
}
} else {
EGG::Matrix34f temp;
temp.makeS(scale);
temp = mat.multiplyTo(temp);

for (size_t i = 0; i < m_points.size(); ++i) {
m_worldPoints[i] = temp.multVector(m_points[i]);
m_worldPoints[i] = temp.ps_multVector(m_points[i]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/game/field/ObjectCollisionCylinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ObjectCollisionCylinder::~ObjectCollisionCylinder() = default;
void ObjectCollisionCylinder::transform(const EGG::Matrix34f &mat, const EGG::Vector3f &scale,
const EGG::Vector3f &speed) {
m_translation = speed;
m_worldPos = scale * m_pos;
m_worldPos = m_pos * scale.x;
m_worldHeight = m_height * scale.y;
m_worldRadius = m_radius * scale.x;

Expand Down

0 comments on commit 0094662

Please sign in to comment.