fix softbody rayintersect bug
This commit is contained in:
@@ -7750,9 +7750,8 @@ RayIntersectWorldResult RayIntersectWorld(const RAY& ray, UINT renderTypeMask, u
|
||||
if (layer.GetLayerMask() & layerMask)
|
||||
{
|
||||
const MeshComponent& mesh = *scene.meshes.GetComponent(object.meshID);
|
||||
const TransformComponent& transform = scene.transforms[object.transform_index];
|
||||
|
||||
const XMMATRIX objectMat = XMLoadFloat4x4(&transform.world);
|
||||
const XMMATRIX objectMat = object.transform_index >= 0 ? XMLoadFloat4x4(&scene.transforms[object.transform_index].world) : XMMatrixIdentity();
|
||||
const XMMATRIX objectMat_Inverse = XMMatrixInverse(nullptr, objectMat);
|
||||
|
||||
const XMVECTOR rayOrigin_local = XMVector3Transform(rayOrigin, objectMat_Inverse);
|
||||
|
||||
@@ -773,6 +773,9 @@ namespace wiSceneSystem
|
||||
|
||||
weights.resize(physicsToGraphicsVertexMapping.size());
|
||||
std::fill(weights.begin(), weights.end(), 1.0f);
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
weights[i] = 0;
|
||||
}
|
||||
|
||||
void CameraComponent::CreatePerspective(float newWidth, float newHeight, float newNear, float newFar, float newFOV)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wiVersion
|
||||
// minor features, major updates
|
||||
const int minor = 21;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 15;
|
||||
const int revision = 16;
|
||||
|
||||
|
||||
long GetVersion()
|
||||
|
||||
Reference in New Issue
Block a user