s&
info
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
explore
Discover Games
category
Workshop
sports_esports
Games
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
menu_book
Learn
docs
Documentation
api
Api Reference
school
Tutorials
manage_search
Code Search
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Common Structs
Rotation
chevron_left
Common Structs
struct
Rotation
Constructors
functions
Rotation
Properties
data_object
Backward
data_object
Conjugate
data_object
Down
data_object
Forward
data_object
Inverse
data_object
Left
data_object
Normal
data_object
Right
data_object
Up
data_object
w
data_object
x
data_object
y
data_object
z
Methods
functions
AlmostEqual
functions
Angle
functions
Angles
functions
Clamp
functions
ClosestAxis
functions
Distance
functions
LerpTo
functions
Pitch
functions
Roll
functions
RotateAroundAxis
functions
SlerpTo
functions
Yaw
Static Fields
crop_din
Identity
Static Properties
data_object
Random
Static Methods
functions
Difference
functions
From
functions
FromAxis
functions
FromPitch
functions
FromRoll
functions
FromToRotation
functions
FromYaw
functions
Lerp
functions
LookAt
functions
Parse
functions
Slerp
functions
SmoothDamp
functions
TryParse
Rotation
Represents a Quaternion rotation. Can be interpreted as a direction unit vector (x,y,z) + rotation around the direction vector (w) which represents the up direction. Unlike Angles, this cannot store multiple revolutions around an axis.
struct
sealed
Sandbox.System
build
Constructors
1
Rotation
(
)
Initializes this rotation to identity.
data_object
Properties
13
Backward
Vector3
The backwards direction of this rotation.
Conjugate
Rotation
Returns conjugate of this rotation, meaning the X Y and Z components are negated.
Down
Vector3
The downwards direction of this rotation.
Forward
Vector3
The forwards direction of this rotation.
Inverse
Rotation
Returns the inverse of this rotation.
Left
Vector3
The left hand direction of this rotation.
Normal
Rotation
Divides each component of the rotation by its length, normalizing the rotation.
Right
Vector3
The right hand direction of this rotation.
Up
Vector3
The upwards direction of this rotation.
w
float
The W component of this rotation (rotation around the normal defined by X,Y,Z components).
x
float
The X component of this rotation.
y
float
The Y component of this rotation.
z
float
The Z component of this rotation.
functions
Methods
12
AlmostEqual
(
r
,
delta
)
bool
Returns true if we're nearly equal to the passed rotation. Checks if each component is within a threshold, and handles the fact that there are two ways to represent the same rotation as a quaternion.
Angle
(
)
float
Returns the turn length of this rotation (from identity) in degrees
Angles
(
)
Angles
Return this Rotation as pitch, yaw, roll angles
Clamp
(
to
,
degrees
)
Rotation
Clamp to within degrees of passed rotation
ClosestAxis
(
normal
)
Vector3
Will give you the axis most aligned with the given normal
Distance
(
to
)
float
The degree angular distance between this rotation and the target
LerpTo
(
target
,
frac
,
clamp
)
Rotation
Perform a linear interpolation from this rotation to a target rotation by given amount.
Pitch
(
)
float
Return this Rotation pitch
Roll
(
)
float
Return this Rotation roll
RotateAroundAxis
(
axis
,
degrees
)
Rotation
A convenience function that rotates this rotation around a given axis given amount of degrees
SlerpTo
(
target
,
frac
,
clamp
)
Rotation
Perform a spherical interpolation from this rotation to a target rotation by given amount.
Yaw
(
)
float
Return this Rotation yaw
crop_din
Static Fields
1
Identity
Rotation
A rotation that represents no rotation.
data_object
Static Properties
1
Random
Rotation
Returns a uniformly random rotation.
functions
Static Methods
13
Difference
(
from
,
to
)
Rotation
Returns the difference between two rotations, as a rotation
From
(
angles
)
Rotation
Create a Rotation (quaternion) from Angles
FromAxis
(
axis
,
degrees
)
Rotation
Create from angle and an axis
FromPitch
(
pitch
)
Rotation
Create a Rotation (quaternion) from pitch (degrees)
FromRoll
(
roll
)
Rotation
Create a Rotation (quaternion) from roll (degrees)
FromToRotation
(
fromDirection
,
toDirection
)
Rotation
Returns a Rotation that rotates from one direction to another.
FromYaw
(
yaw
)
Rotation
Create a Rotation (quaternion) from yaw (degrees)
Lerp
(
a
,
b
,
frac
,
clamp
)
Rotation
Perform a linear interpolation from a to b by given amount.
LookAt
(
forward
,
up
)
Rotation
Create a Rotation (quaternion) from a forward and up vector
Parse
(
str
)
Rotation
Given a string, try to convert this into a quaternion rotation. The format is "x,y,z,w"
Slerp
(
a
,
b
,
amount
,
clamp
)
Rotation
Perform a spherical interpolation from a to b by given amount.
SmoothDamp
(
current
,
target
,
velocity
,
smoothTime
,
deltaTime
)
Rotation
Smoothly move towards the target rotation
TryParse
(
str
,
result
)
bool
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.