metaforce/Runtime/Collision/CJointCollisionDescription.cpp

60 lines
2.5 KiB
C++
Raw Normal View History

2017-03-01 03:42:06 +00:00
#include "Collision/CJointCollisionDescription.hpp"
namespace urde
{
CJointCollisionDescription::CJointCollisionDescription(ECollisionType colType, CSegId seg1, CSegId seg2,
const zeus::CVector3f& v1, const zeus::CVector3f& v2, float f1,
float f2, EOrientationType orientType, const std::string& name,
float f3)
: x0_colType(colType)
, x4_orientType(orientType)
, x8_(seg1)
, x9_(seg2)
, xc_(v1)
, x18_(v2)
, x24_(f1)
, x28_(f2)
, x2c_name(name)
, x40_(f3)
2017-03-01 03:42:06 +00:00
{
}
2017-03-26 04:12:06 +00:00
CJointCollisionDescription CJointCollisionDescription::SphereSubdivideCollision(CSegId seg1, CSegId seg2, float f1,
float f2, EOrientationType orientType,
const std::string& name, float f3)
{
return CJointCollisionDescription(ECollisionType::SphereSubdivide, seg1, seg2, zeus::CVector3f::skZero,
zeus::CVector3f::skZero, f1, f2, orientType, name, f3);
}
2017-04-22 21:47:27 +00:00
CJointCollisionDescription CJointCollisionDescription::SphereCollision(CSegId segId, float f1, const std::string& name, float f2)
{
return CJointCollisionDescription(ECollisionType::Sphere, segId, -1, zeus::CVector3f::skZero,
zeus::CVector3f::skZero, f1, 0.f, EOrientationType::Zero, name, f2);
}
2017-03-26 04:12:06 +00:00
CJointCollisionDescription CJointCollisionDescription::AABoxCollision(CSegId segId, const zeus::CVector3f& v1,
const std::string& name, float f1)
{
return CJointCollisionDescription(ECollisionType::AABox, segId, -1, v1, zeus::CVector3f::skZero, 0.f, 0.f,
EOrientationType::Zero, name, f1);
}
CJointCollisionDescription CJointCollisionDescription::OBBCollision(CSegId segId, const zeus::CVector3f& v1,
const zeus::CVector3f& v2, const std::string& name,
float f1)
{
return CJointCollisionDescription(ECollisionType::OBB, segId, -1, v1, v2, 0.f, 0.f, EOrientationType::Zero, name,
f1);
}
2017-05-07 06:55:01 +00:00
void CJointCollisionDescription::ScaleAllBounds(const zeus::CVector3f& scale)
{
xc_ *= scale;
x24_ *= scale.x;
x28_ *= scale.x;
x18_ *= scale;
}
2017-03-01 03:42:06 +00:00
}