Interface IDesignSceneGroundShape
- Namespace
- CodeSmile.AnyMotion.AnimateYourself.Samples /
- Assembly
- ApiSource.dll
The shape of the ground the design scene walks a character over. Implement this on a UnityEngine.MonoBehaviour in the design scene and assign that component to DesignScene's Ground Shape field to replace the flat default.
public interface IDesignSceneGroundShape
Expand Details ...
Remarks
This is the extension point for the planned adjustable slope and stairs. Both of those need two numbers per position along the travel axis and nothing else: how high the ground is there, and how steeply it rises there. DesignScene asks for both once per frame and applies them to the character's own transform, so a new implementation of this interface changes neither the camera code, the take sequencing nor the preset code.
The character in the design scene has no UnityEngine.CharacterController and no physics of any kind. Its height and pitch come from this interface directly, which is what lets a slope be followed with no controller involved.
Methods
HeightAt(float)
Height of the ground surface, in metres, at the given position along the travel axis. The character's feet stand on this height.
float HeightAt(float travelPosition)
Parameters
| Type | Name | Description |
|---|---|---|
travelPosition |
Position along the travel axis, in metres, measured in world space. |
Returns
- float
SlopeDegreesAt(float)
Angle the ground rises at the given position along the travel axis, in degrees. Positive is
ground rising in the direction of increasing travelPosition. The character
is pitched by this angle so it stands perpendicular to the surface.
float SlopeDegreesAt(float travelPosition)
Parameters
| Type | Name | Description |
|---|---|---|
travelPosition |
Position along the travel axis, in metres, measured in world space. |
Returns
- float