Impact Interaction System API
Impact.Objects.ImpactTerrain Class Reference

Component for Impact Objects attached to a terrain. More...

Inheritance diagram for Impact.Objects.ImpactTerrain:
Impact.Objects.ImpactObjectBase Impact.Objects.IImpactObject

Public Member Functions

void RefreshCachedAlphamaps ()
 Refresh the cached alphamaps/splatmaps. Use this if your alphamaps can change during runtime.
 
void SyncTerrainLayersAndMaterialsList ()
 Syncs the terrain layers and materials list so they are the same length.
 
override int GetMaterialCompositionNonAlloc (Vector3 point, ImpactMaterialComposition[] results)
 Gets the material composition at the given point by filling out the given array. More...
 
override IImpactMaterial GetPrimaryMaterial (Vector3 point)
 Gets the primary material at the given point. More...
 
override IImpactMaterial GetPrimaryMaterial ()
 Gets the primary material without knowing the contact point. More...
 
- Public Member Functions inherited from Impact.Objects.ImpactObjectBase
virtual VelocityData GetVelocityDataAtPoint (Vector3 point)
 Gets this object's velocity data at the given point. By default this returns empty data. More...
 
virtual Vector3 GetContactPointRelativePosition (Vector3 point)
 Gets the local position of the contact point relative to this object's transform. More...
 
abstract int GetMaterialCompositionNonAlloc (Vector3 point, ImpactMaterialComposition[] results)
 Gets the material composition at the given point by filling out the given array. More...
 
abstract IImpactMaterial GetPrimaryMaterial (Vector3 point)
 Gets the primary material at the given point. More...
 
abstract IImpactMaterial GetPrimaryMaterial ()
 Gets the primary material without knowing the contact point. More...
 
int GetMaterialCompositionNonAlloc (Vector3 point, ImpactMaterialComposition[] results)
 Gets the material composition at the given point by filling out the given array. More...
 
IImpactMaterial GetPrimaryMaterial (Vector3 point)
 Gets the primary material at the given point. More...
 
IImpactMaterial GetPrimaryMaterial ()
 Gets the primary material without knowing the contact point. More...
 
VelocityData GetVelocityDataAtPoint (Vector3 contactPoint)
 Gets this object's velocity data at the given point. More...
 
Vector3 GetContactPointRelativePosition (Vector3 point)
 Gets the local position of the contact point relative to this object's transform. More...
 

Properties

Terrain Terrain [get, set]
 The terrain associated with this object.
 
List< ImpactMaterialBaseTerrainMaterials [get]
 The list of materials that correspond to the terrain's terrain layers.
 
- Properties inherited from Impact.Objects.ImpactObjectBase
int Priority [get, set]
 How important this object is. More...
 
GameObject GameObject [get]
 The GameObject associated with this object. More...
 
- Properties inherited from Impact.Objects.IImpactObject
int Priority [get]
 How important this object is. More...
 
GameObject GameObject [get]
 The GameObject associated with this object. More...
 

Additional Inherited Members

- Protected Attributes inherited from Impact.Objects.ImpactObjectBase
int _priority
 

Detailed Description

Component for Impact Objects attached to a terrain.

Member Function Documentation

◆ GetMaterialCompositionNonAlloc()

override int Impact.Objects.ImpactTerrain.GetMaterialCompositionNonAlloc ( Vector3  point,
ImpactMaterialComposition[]  results 
)
virtual

Gets the material composition at the given point by filling out the given array.

Parameters
pointThe point to get materials at.
resultsA pre-allocated array to put the results into.
Returns
The number of results.

Implements Impact.Objects.ImpactObjectBase.

◆ GetPrimaryMaterial() [1/2]

override IImpactMaterial Impact.Objects.ImpactTerrain.GetPrimaryMaterial ( )
virtual

Gets the primary material without knowing the contact point.

Returns
The primary material of the object.

Implements Impact.Objects.ImpactObjectBase.

◆ GetPrimaryMaterial() [2/2]

override IImpactMaterial Impact.Objects.ImpactTerrain.GetPrimaryMaterial ( Vector3  point)
virtual

Gets the primary material at the given point.

Parameters
pointThe point to get materias at.
Returns
The primary material, if there is one.

Implements Impact.Objects.ImpactObjectBase.