struct Oid::Vector3
- Oid::Vector3
- Struct
- Value
- Object
Overview
Representation of 3D vector
Included Modules
- JSON::Serializable
- Oid::Vector
Defined in:
oid/resources/vectors/quaternion.croid/resources/vectors/vector3.cr
Constructors
Class Method Summary
-
.back
Shorthand for writing Vector3.new(x: 0, y: 0, z: -1).
-
.down
Shorthand for writing Vector3.new(x: 0, y: -1, z: 0).
-
.forward
Shorthand for writing Vector3.new(x: 0, y: 0, z: 1).
-
.left
Shorthand for writing Vector3.new(x: -1, y: 0, z: 0).
-
.right
Shorthand for writing Vector3.new(x: 1, y: 0, z: 0).
-
.up
Shorthand for writing Vector3.new(x: 0, y: 1, z: 0).
-
.zero
Zero vector
Instance Method Summary
- #!=(other : Vector)
-
#*(other : Vector)
Performs component multiplication (for dot product see
#dot
) -
#*(other : Float64)
Performs multiplication
-
#+(other : Vector)
Performs component addition
-
#+(other : Float64)
Performs component addition
-
#-(other : Vector)
Performs component subtraction
- #-(other : Float64)
-
#-
Returns negated vector
- #/(other : Vector)
- #==(other : self)
- #angle(other : Vector)
- #angle
- #clone
-
#cross(other)
Cross product
- #distance(other : Vector)
-
#dot(other)
Dot product
- #find_normal_axis(other : Vector)
- #magnitude
-
#normalize!
Normalizes current vector
- #reflect(q : Quaternion)
- #rotate(euler : Vector3)
- #rotate(q : Quaternion)
- #to_v2
- #to_v4
- #values
- #x : Float64
- #x=(x : Float64)
- #y : Float64
- #y=(y : Float64)
- #z : Float64
- #z=(z : Float64)
- #zero!
Instance methods inherited from module Oid::Vector
!=(other)
!=,
%(other : Vector)
%,
*(other : Vector)*(other : Float64) *, **(other : Vector) **, +(other : Vector)
+(other : Float64) +, -(other : Vector)
- -, /(other : Vector)
/(other : Float64) /, ==(other) ==, clone
clone(&b) clone, cross(other) cross, distance(other : Vector) distance, dot(other) dot, heading heading, mag mag, magnitude magnitude, normalize normalize, normalize! normalize!, values values, zero! zero!
Constructor Detail
Class Method Detail
Instance Method Detail
Description copied from module Oid::Vector
Performs component multiplication (for dot product see #dot
)
Description copied from module Oid::Vector
Performs component addition
Description copied from module Oid::Vector
Performs component subtraction