mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 19:53:48 +00:00
put probe.boxmax/min code back as it was prior to merge. still having that /4 oddness.
This commit is contained in:
parent
5bcbd0f6c9
commit
f55dc92f6b
2 changed files with 4 additions and 7 deletions
|
|
@ -346,7 +346,7 @@ void RenderProbeMgr::_setupStaticParameters()
|
|||
|
||||
probeWorldToObjData[mEffectiveProbeCount] = curEntry.getTransform();
|
||||
Point3F bbMin = refPos - curEntry.mProbeRefScale/2;
|
||||
Point3F bbMax = curEntry.mExtents/4;
|
||||
Point3F bbMax = refPos + curEntry.mProbeRefScale/2;
|
||||
probeBBMinData[mEffectiveProbeCount] = Point4F(bbMin.x, bbMin.y, bbMin.z, 0);
|
||||
probeBBMaxData[mEffectiveProbeCount] = Point4F(bbMax.x, bbMax.y, bbMax.z, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -86,12 +86,9 @@ float3 boxProject(Surface surface, ProbeData probe)
|
|||
float3 RayLS = mul(probe.worldToLocal, float4(surface.R,0.0)).xyz;
|
||||
float3 PositionLS = mul( probe.worldToLocal, float4(surface.P,1.0)).xyz;
|
||||
|
||||
//float3 invRayLS = rcp(RayLS);
|
||||
float3 unit = float3(1,1,1);
|
||||
float3 plane1vec = (unit - PositionLS) / RayLS;
|
||||
float3 plane2vec = (-unit - PositionLS) / RayLS;
|
||||
//float3 plane1vec = invRayLS - PositionLS * RayLS;
|
||||
//float3 plane2vec = -invRayLS - PositionLS * RayLS;
|
||||
float3 unit = probe.boxMax-probe.boxMin;
|
||||
float3 plane1vec = (unit/2 - PositionLS) / RayLS;
|
||||
float3 plane2vec = (-unit/2 - PositionLS) / RayLS;
|
||||
float3 furthestPlane = max(plane1vec, plane2vec);
|
||||
float dist = min(min(furthestPlane.x, furthestPlane.y), furthestPlane.z);
|
||||
float3 posonbox = surface.P + surface.R * dist;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue