fix softbody rayintersect bug

This commit is contained in:
turanszkij
2018-10-20 18:49:50 +01:00
parent a5d5661e5a
commit 5b031a8657
3 changed files with 5 additions and 3 deletions
+1 -2
View File
@@ -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);
+3
View File
@@ -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)
+1 -1
View File
@@ -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()