mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Fixed GroundCover placement on rotated TerrainBlocks.
This commit is contained in:
parent
95ef5ec226
commit
8bc72ad9f9
1 changed files with 5 additions and 2 deletions
|
|
@ -1225,14 +1225,17 @@ GroundCoverCell* GroundCover::_generateCell( const Point2I& index,
|
||||||
flipBB *= -1.0f;
|
flipBB *= -1.0f;
|
||||||
|
|
||||||
PROFILE_START( GroundCover_TerrainRayCast );
|
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 );
|
&normal, &h, matName );
|
||||||
|
PROFILE_END(); // GroundCover_TerrainRayCast
|
||||||
|
|
||||||
// TODO: When did we loose the world space elevation when
|
// TODO: When did we loose the world space elevation when
|
||||||
// getting the terrain height?
|
// getting the terrain height?
|
||||||
h += pos.z + mZOffset;
|
h += pos.z + mZOffset;
|
||||||
|
|
||||||
PROFILE_END(); // GroundCover_TerrainRayCast
|
|
||||||
if ( !hit || h > typeMaxElevation || h < typeMinElevation ||
|
if ( !hit || h > typeMaxElevation || h < typeMinElevation ||
|
||||||
( typeLayer[0] && !typeInvertLayer && matName != typeLayer ) ||
|
( typeLayer[0] && !typeInvertLayer && matName != typeLayer ) ||
|
||||||
( typeLayer[0] && typeInvertLayer && matName == typeLayer ) )
|
( typeLayer[0] && typeInvertLayer && matName == typeLayer ) )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue