public sealed struct Angles
Euler angles. Unlike a Rotation, Euler angles can represent multiple revolutions (rotations) around an axis, but suffer from issues like gimbal lock and lack of a defined "up" vector. Use Rotation for most cases.
Related Guides
Broader workflow and conceptual references connected to this API.
You can broadcast and listen to events in your scene using interfaces.
A GameObject represents an object in the scene world. It contains a few different elements.
A Vector is just a set of numbers that describe a position or a direction in space.
To make a multiplayer game you need to take care of a few things. There's a special component that helps with those things, called NetworkHelper. This is a simple component that fits a lot of situations, but can be used as an example to code your own network component.
The PlayerController component is a first and third person player controller.
This section needs to be rewritten with an explanation of all the code, libraries, etc.
Constructors
Showing 4 constructors
No results match this filter.
Methods
Showing 17 methods
public Vector3 AsVector3()
Return as a Vector3, where x = pitch etc
public static float ClampAngle(float v)
Clamps the angle to range of [0, 360)
public Angles Clamped()
Returns clamped version of this object, meaning the angle on each axis is transformed to range of [0,360).
public bool IsNearlyZero(double tolerance = 1E-06)
Returns true if this angles object's components are all nearly zero with given tolerance.
Parameters
tolerance: Default: 1E-06
public static Angles Lerp(Angles source, Angles target, float frac)
Performs linear interpolation on the two given angle objects.
Parameters
source: Angle Atarget: Angle Bfrac: Fraction in range [0,1] between the 2 angle objects to use for interpolation.
public Angles LerpTo(Angles target, float frac)
Performs linear interpolation on the two given angle objects.
Parameters
target: Angle Bfrac: Fraction in range [0,1] between the 2 angle objects to use for interpolation.
public static float NormalizeAngle(float v)
Normalizes the angle to range of (-180, 180]
public Angles SnapToGrid(float gridSize, bool sx = True, bool sy = True, bool sz = True)
Snap to grid
Parameters
sx: Default: Truesy: Default: Truesz: Default: True
public Rotation ToRotation()
Converts these Euler angles to a rotation. The angles will be normalized.
public Angles WithPitch(float pitch)
Returns this angles object with given pitch component.
public Angles WithRoll(float roll)
Returns this angles object with given roll component.
public Angles WithYaw(float yaw)
Returns this angles object with given yaw component.
No results match this filter.
Properties
Showing 3 properties
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | global |
| Type | class |
| Assembly | Sandbox.System |
| Doc ID | T:Angles |