mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Fixed GroundCover placement on rotated TerrainBlocks.
This commit is contained in:
parent
95ef5ec226
commit
8bc72ad9f9
|
|
@ -1225,14 +1225,17 @@ GroundCoverCell* GroundCover::_generateCell( const Point2I& index,
|
|||
flipBB *= -1.0f;
|
||||
|
||||
PROFILE_START( GroundCover_TerrainRayCast );
|
||||
hit = terrainBlock->getNormalHeightMaterial( Point2F( cp.x - pos.x, cp.y - pos.y ),
|
||||
// Transform billboard point into terrain's frame of reference.
|
||||
Point3F pp = Point3F(cp.x, cp.y, 0);
|
||||
terrainBlock->getWorldTransform().mulP(pp);
|
||||
hit = terrainBlock->getNormalHeightMaterial( Point2F ( pp.x, pp.y ),
|
||||
&normal, &h, matName );
|
||||
PROFILE_END(); // GroundCover_TerrainRayCast
|
||||
|
||||
// TODO: When did we loose the world space elevation when
|
||||
// getting the terrain height?
|
||||
h += pos.z + mZOffset;
|
||||
|
||||
PROFILE_END(); // GroundCover_TerrainRayCast
|
||||
if ( !hit || h > typeMaxElevation || h < typeMinElevation ||
|
||||
( typeLayer[0] && !typeInvertLayer && matName != typeLayer ) ||
|
||||
( typeLayer[0] && typeInvertLayer && matName == typeLayer ) )
|
||||
|
|
|
|||
Loading…
Reference in a new issue