types

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 2 Imported by: 5

Documentation

Overview

The types package provides an implementation of non-primitive Roblox types.

Index

Constants

View Source
const BrickColorIndexSize = 208
View Source
const BrickColorPaletteSize = 128

Variables

This section is empty.

Functions

This section is empty.

Types

type Aliaser

type Aliaser interface {
	Value
	Alias() Value
}

Aliaser is a Value that has an underlying Value of a different type.

type Axes

type Axes struct {
	X, Y, Z bool
}

Axes represents a set of orthogonal coordinate axes that are considered active.

func NewAxesFromAxis

func NewAxesFromAxis(axes ...Axis) Axes

NewAxesFromAxis returns an Axes where the axes corresponding to the given Axis values are active.

func NewAxesFromFace

func NewAxesFromFace(faces ...Face) Axes

NewAxesFromFace returns an Axes where the axes corresponding to the given Face values are active.

func (Axes) Copy

func (a Axes) Copy() PropValue

Copy returns a copy of the value.

func (Axes) Face

func (a Axes) Face(face Face) bool

Face returns whether the axis corresponding to the given Face is active.

func (Axes) String

func (a Axes) String() string

String returns a human-readable string representation of the value.

func (Axes) Type

func (Axes) Type() string

Type returns a string that identifies the type.

type Axis

type Axis int8

Axis represents an orthographic axis in a 3-dimensional coordinate system.

const (
	AxisX Axis
	AxisY
	AxisZ
)

func (Axis) Valid

func (axis Axis) Valid() bool

Valid returns whether the value is valid.

type BinaryString

type BinaryString string

func (BinaryString) Copy

func (s BinaryString) Copy() PropValue

Copy returns a copy of the value.

func (BinaryString) String

func (s BinaryString) String() string

String returns a human-readable string representation of the value.

func (BinaryString) Stringlike

func (s BinaryString) Stringlike() string

Stringlike returns the value as a string.

func (BinaryString) Type

func (BinaryString) Type() string

Type returns a string that identifies the type.

type Bool

type Bool bool

Bool represents one of two possible states.

const (
	True  Bool = true
	False Bool = false
)

func (Bool) Copy

func (b Bool) Copy() PropValue

Copy returns a copy of the value.

func (Bool) String

func (b Bool) String() string

String returns a human-readable string representation of the value.

func (Bool) Type

func (Bool) Type() string

Type returns a string that identifies the type.

type BrickColor

type BrickColor uint32

BrickColor represents a color from a predefined collection.

const BrickColorDefault BrickColor = 194

func NewBrickColor

func NewBrickColor(number int) BrickColor

NewBrickColor returns the BrickColor that corresponds to the given numeric value.

The the given number has no corresponding BrickColor, then BrickColorDefault is returned.

func NewBrickColorFromColor

func NewBrickColorFromColor(r, g, b float64) BrickColor

NewBrickColorFromColor returns the BrickColor that is nearest to the given color components. Each component is in the interval [0, 1].

func NewBrickColorFromColor3

func NewBrickColorFromColor3(color Color3) BrickColor

NewBrickColorFromColor3 returns the BrickColor that is nearest to the given color.

func NewBrickColorFromIndex

func NewBrickColorFromIndex(index int) BrickColor

NewBrickColorFromIndex returns the BrickColor that corresponds to the given index.

If the index is less than 0 or greater than or equal to BrickColorIndexSize, then BrickColorDefault is returned.

func NewBrickColorFromName

func NewBrickColorFromName(name string) BrickColor

NewBrickColorFromName returns the BrickColor that corresponds the given name.

The the given name has no corresponding BrickColor, then BrickColorDefault is returned.

func NewBrickColorFromPalette

func NewBrickColorFromPalette(index int) BrickColor

NewBrickColorFromPalette returns the BrickColor that corresponds to the given palette index.

If the index is less than 0 or greater than or equal to BrickColorPaletteSize, then BrickColorDefault is returned.

func (BrickColor) B

func (b BrickColor) B() float64

B returns the blue component of the BrickColor's color.

func (BrickColor) Color

func (b BrickColor) Color() Color3

Color returns the color of the BrickColor as a Color3.

func (BrickColor) Copy

func (b BrickColor) Copy() PropValue

Copy returns a copy of the value.

func (BrickColor) G

func (b BrickColor) G() float64

G returns the green component of the BrickColor's color.

func (BrickColor) Index

func (b BrickColor) Index() int

Index returns the index of the BrickColor.

func (BrickColor) Name

func (b BrickColor) Name() string

Name returns the name of the BrickColor.

func (BrickColor) Number

func (b BrickColor) Number() int

Number returns the numeric value that identifies the BrickColor.

func (BrickColor) R

func (b BrickColor) R() float64

R returns the red component of the BrickColor's color.

func (BrickColor) String

func (b BrickColor) String() string

String returns a human-readable string representation of the value.

func (BrickColor) Type

func (BrickColor) Type() string

Type returns a string that identifies the type.

type CFrame

type CFrame struct {
	Position Vector3
	Rotation [9]float32
}

CFrame is a matrix representing a combined position and orientation.

func NewCFrame

func NewCFrame() CFrame

NewCFrame returns a CFrame with the default orientation located at the origin.

func NewCFrameFromAngles

func NewCFrameFromAngles(rx, ry, rz float64) CFrame

NewCFrameFromAngles returns a CFrame located at the origin, oriented according to the angles (rx, ry, rz), in radians. Rotations are ordered Z, Y, X.

func NewCFrameFromAxisAngle

func NewCFrameFromAxisAngle(axis Vector3, rotation float64) CFrame

NewCFrameFromAxisAngle returns a CFrame located at the origin, rotated *r* radians around *axis*.

func NewCFrameFromComponents

func NewCFrameFromComponents(x, y, z, r00, r01, r02, r10, r11, r12, r20, r21, r22 float64) CFrame

NewCFrameFromComponents returns a CFrame located at (x, y, z), oriented according to the rotation matrix

[r00, r01, r02]
[r10, r11, r12]
[r20, r21, r22]

func NewCFrameFromLook

func NewCFrameFromLook(pos, lookAt Vector3) CFrame

NewCFrameFromLook returns a CFrame located at *pos*, facing towards *lookAt*. The local upward direction is (0, 1, 0).

func NewCFrameFromLookAt

func NewCFrameFromLookAt(pos, lookAt, up Vector3) CFrame

NewCFrameFromLookAt returns a CFrame located at *pos*, facing towards *lookAt*, with the local upward direction determined by *up*.

func NewCFrameFromMatrix

func NewCFrameFromMatrix(p, vx, vy, vz Vector3) CFrame

NewCFrameFromMatrix returns a CFrame located at *p*, rotated according to the rotation matrix

[vx.X, vy.X, vz.X]
[vx.Y, vy.Y, vz.Y]
[vx.Z, vy.Z, vz.Z]

If *vz* is the zero vector, then *vz* is calculated as the unit of the cross product of vx and vy.

func NewCFrameFromOrientation

func NewCFrameFromOrientation(rx, ry, rz float64) CFrame

NewCFrameFromOrientation returns a CFrame located at the origin, oriented according to the angles (rx, ry, rz), in radians. Rotations are ordered Y, X, Z.

func NewCFrameFromPosition

func NewCFrameFromPosition(x, y, z float64) CFrame

NewCFrameFromPosition returns a CFrame located at (x, y, z), with the default orientation.

func NewCFrameFromQuat

func NewCFrameFromQuat(x, y, z, qx, qy, qz, qw float64) CFrame

NewCFrameFromQuat returns a CFrame located at (x, y, z), oriented according to the quaternion (qx, qy, qz, qw).

func NewCFrameFromVector3

func NewCFrameFromVector3(v Vector3) CFrame

NewCFrameFromVector3 returns a CFrame with the default orientation located at *v*.

func (CFrame) AddV3

func (c CFrame) AddV3(op Vector3) CFrame

AddV3 returns the CFrame translated in world space by *op*.

func (CFrame) Angles

func (c CFrame) Angles() (rx, ry, rz float64)

Angles returns the approximate angles of the CFrame's orientation, in radians, if ordered Z, Y, X.

func (CFrame) AxisAngle

func (c CFrame) AxisAngle() (axis Vector3, rotation float64)

AxisAngle returns the orientation of the CFrame as an angle, in radians, rotated around an axis.

func (CFrame) Components

func (c CFrame) Components() (x, y, z, r00, r01, r02, r10, r11, r12, r20, r21, r22 float64)

Components returns the components of the CFrame's position and rotation matrix.

func (CFrame) Copy

func (c CFrame) Copy() PropValue

Copy returns a copy of the value.

func (CFrame) Inverse

func (c CFrame) Inverse() CFrame

Inverse returns the inverse of the CFrame.

func (CFrame) Lerp

func (c CFrame) Lerp(goal CFrame, alpha float64) CFrame

Lerp returns a CFrame linearly interpolated from the CFrame to *goal* according to *alpha*, which has an interval of [0, 1].

func (CFrame) LookVector

func (c CFrame) LookVector() Vector3

LookVector returns the forward-direction, or the negation of the third column of the rotation matrix.

func (CFrame) Mul

func (a CFrame) Mul(b CFrame) CFrame

Mul returns the composition of two CFrames.

func (CFrame) MulV3

func (c CFrame) MulV3(op Vector3) Vector3

MulV3 returns *op* transformed from local to world space of the CFrame.

func (CFrame) Orientation

func (c CFrame) Orientation() (rx, ry, rz float64)

Orientation returns the approximate angles of the CFrame's orientation, in radians, if ordered Y, X, Z.

func (CFrame) PointToObjectSpace

func (c CFrame) PointToObjectSpace(v Vector3) Vector3

PointToObjectSpace returns a Vector3 transformed from world to local space of the CFrame.

func (CFrame) PointToWorldSpace

func (c CFrame) PointToWorldSpace(v Vector3) Vector3

PointToWorldSpace returns a Vector3 transformed from local to world space of the CFrame.

func (CFrame) Quaternion

func (c CFrame) Quaternion() (qx, qy, qz, qw float64)

Quaternion returns the rotation matrix as a quaternion.

func (CFrame) RightVector

func (c CFrame) RightVector() Vector3

RightVector returns the right-direction, or first column of the rotation matrix.

func (CFrame) String

func (c CFrame) String() string

String returns a human-readable string representation of the value.

func (CFrame) SubV3

func (c CFrame) SubV3(op Vector3) CFrame

SubV3 returns the CFrame translated in world space by the negation of *op*.

func (CFrame) ToObjectSpace

func (c CFrame) ToObjectSpace(cf CFrame) CFrame

ToObjectSpace returns the CFrame transformed from world to local space of *cf*.

func (CFrame) ToWorldSpace

func (c CFrame) ToWorldSpace(cf CFrame) CFrame

ToWorldSpace returns the CFrame transformed from local to world space of *cf*.

func (CFrame) Type

func (CFrame) Type() string

Type returns a string that identifies the type.

func (CFrame) UpVector

func (c CFrame) UpVector() Vector3

UpVector returns the up-direction, or second column of the rotation matrix.

func (CFrame) VectorToObjectSpace

func (c CFrame) VectorToObjectSpace(v Vector3) Vector3

VectorToObjectSpace returns a Vector3 rotated from world to local space of the CFrame.

func (CFrame) VectorToWorldSpace

func (c CFrame) VectorToWorldSpace(v Vector3) Vector3

VectorToWorldSpace returns a Vector3 rotated from local to world space of the CFrame.

func (CFrame) X

func (c CFrame) X() float64

X returns the X component of the Position.

func (CFrame) XVector

func (c CFrame) XVector() Vector3

XVector returns the first row of the rotation matrix.

func (CFrame) Y

func (c CFrame) Y() float64

Y returns the Y component of the Position.

func (CFrame) YVector

func (c CFrame) YVector() Vector3

YVector returns the second row the rotation matrix.

func (CFrame) Z

func (c CFrame) Z() float64

Z returns the Z component of the Position.

func (CFrame) ZVector

func (c CFrame) ZVector() Vector3

ZVector returns the third row of the rotation matrix.

type Color3

type Color3 struct {
	R, G, B float32
}

Color3 represents a color in RGB space.

func NewColor3FromHSV

func NewColor3FromHSV(h, s, v float64) (c Color3)

NewColor3FromHSV returns a Color3 from the given hue, saturation, and value.

func NewColor3FromRGB

func NewColor3FromRGB(r, g, b int) Color3

NewColor3FromRGB returns a Color3 from the given red, green, and blue components, each having an interval of [0, 255].

func (Color3) Copy

func (c Color3) Copy() PropValue

Copy returns a copy of the value.

func (Color3) Lerp

func (c Color3) Lerp(goal Color3, alpha float64) Color3

Lerp returns a Color3 linearly interpolated between *c* and *goal*, according to *alpha*, which has an interval of [0, 1].

func (Color3) String

func (c Color3) String() string

String returns a human-readable string representation of the value.

func (Color3) ToHSV

func (c Color3) ToHSV() (h, s, v float64)

ToHSV returns the hue, saturation, and value of the color.

func (Color3) Type

func (Color3) Type() string

Type returns a string that identifies the type.

type ColorSequence

type ColorSequence []ColorSequenceKeypoint

ColorSequence represents an interpolated sequence of colors.

func (ColorSequence) Copy

func (c ColorSequence) Copy() PropValue

Copy returns a copy of the value.

func (ColorSequence) String

func (c ColorSequence) String() string

String returns a human-readable string representation of the value.

func (ColorSequence) Type

func (ColorSequence) Type() string

Type returns a string that identifies the type.

type ColorSequenceKeypoint

type ColorSequenceKeypoint struct {
	Time     float32
	Value    Color3
	Envelope float32
}

ColorSequenceKeypoint is a keypoint in a ColorSequence.

func (ColorSequenceKeypoint) Copy

Copy returns a copy of the value.

func (ColorSequenceKeypoint) String

func (c ColorSequenceKeypoint) String() string

String returns a human-readable string representation of the value.

func (ColorSequenceKeypoint) Type

Type returns a string that identifies the type.

type Content

type Content string

Content is a URI pointing to a resource.

func (Content) Copy

func (s Content) Copy() PropValue

Copy returns a copy of the value.

func (Content) String

func (s Content) String() string

String returns a human-readable string representation of the value.

func (Content) Stringlike

func (s Content) Stringlike() string

Stringlike returns the value as a string.

func (Content) Type

func (Content) Type() string

Type returns a string that identifies the type.

type Double

type Double float64

Double is a 64-bit floating-point number.

func (Double) Copy

func (d Double) Copy() PropValue

Copy returns a copy of the value.

func (Double) Intlike

func (d Double) Intlike() int64

Intlike returns the value as an integer.

func (Double) Numberlike

func (d Double) Numberlike() float64

Numberlike returns the value as a float.

func (Double) String

func (d Double) String() string

String returns a human-readable string representation of the value.

func (Double) Type

func (Double) Type() string

Type returns a string that identifies the type.

type Face

type Face int8

Face represents a 3-dimensional egocentric direction, each value corresponding to one of the 3 orthographic axes.

const (
	FaceRight  Face // +X
	FaceTop         // +Y
	FaceBack        // +Z
	FaceLeft        // -X
	FaceBottom      // -X
	FaceFront       // -Z
)

func (Face) Valid

func (face Face) Valid() bool

Valid returns whether the value is valid.

type Faces

type Faces struct {
	Right, Top, Back, Left, Bottom, Front bool
}

Faces represents a set of directions, on three orthogonal axes, that are considered active.

func NewFacesFromAxis

func NewFacesFromAxis(axes ...Axis) Faces

NewFacesFromAxis returns a Faces where the faces corresponding to the given Axis values are active.

func NewFacesFromFace

func NewFacesFromFace(faces ...Face) Faces

NewFacesFromFace returns a Faces where the faces corresponding to the given Face values are active.

func (Faces) Copy

func (f Faces) Copy() PropValue

Copy returns a copy of the value.

func (Faces) String

func (f Faces) String() string

String returns a human-readable string representation of the value.

func (Faces) Type

func (Faces) Type() string

Type returns a string that identifies the type.

type Float

type Float float32

Float is a 32-bit floating-point number.

func (Float) Copy

func (f Float) Copy() PropValue

Copy returns a copy of the value.

func (Float) Intlike

func (f Float) Intlike() int64

Intlike returns the value as an integer.

func (Float) Numberlike

func (f Float) Numberlike() float64

Numberlike returns the value as a float.

func (Float) String

func (f Float) String() string

String returns a human-readable string representation of the value.

func (Float) Type

func (Float) Type() string

Type returns a string that identifies the type.

type Int

type Int int32

func (Int) Copy

func (i Int) Copy() PropValue

func (Int) Intlike

func (i Int) Intlike() int64

func (Int) Numberlike

func (i Int) Numberlike() float64

func (Int) String

func (i Int) String() string

func (Int) Type

func (Int) Type() string

type Int64

type Int64 int64

Int64 is a 64-bit signed integer.

func (Int64) Copy

func (i Int64) Copy() PropValue

Copy returns a copy of the value.

func (Int64) Intlike

func (i Int64) Intlike() int64

Intlike returns the value as an integer.

func (Int64) Numberlike

func (i Int64) Numberlike() float64

Numberlike returns the value as a float.

func (Int64) String

func (i Int64) String() string

String returns a human-readable string representation of the value.

func (Int64) Type

func (Int64) Type() string

Type returns a string that identifies the type.

type Intlike

type Intlike interface {
	Value
	Intlike() int64
}

Intlike is any value that can be converted to an integer.

type NumberRange

type NumberRange struct {
	Min, Max float32
}

NumberRange represents a range between two numbers as a minimum and maximum.

func (NumberRange) Copy

func (n NumberRange) Copy() PropValue

Copy returns a copy of the value.

func (NumberRange) String

func (n NumberRange) String() string

String returns a human-readable string representation of the value.

func (NumberRange) Type

func (NumberRange) Type() string

Type returns a string that identifies the type.

type NumberSequence

type NumberSequence []NumberSequenceKeypoint

NumberSequence represents an interpolated sequence of numbers.

func (NumberSequence) Copy

func (n NumberSequence) Copy() PropValue

Copy returns a copy of the value.

func (NumberSequence) String

func (n NumberSequence) String() string

String returns a human-readable string representation of the value.

func (NumberSequence) Type

func (NumberSequence) Type() string

Type returns a string that identifies the type.

type NumberSequenceKeypoint

type NumberSequenceKeypoint struct {
	Time     float32
	Value    float32
	Envelope float32
}

NumberSequenceKeypoint is a keypoint in a NumberSequence.

func (NumberSequenceKeypoint) Copy

Copy returns a copy of the value.

func (NumberSequenceKeypoint) String

func (n NumberSequenceKeypoint) String() string

String returns a human-readable string representation of the value.

func (NumberSequenceKeypoint) Type

Type returns a string identifying the type.

type Numberlike

type Numberlike interface {
	Value
	Numberlike() float64
}

Numberlike is any value that can be converted to a floating-point number.

type PhysicalProperties

type PhysicalProperties struct {
	CustomPhysics    bool
	Density          float32
	Friction         float32
	Elasticity       float32
	FrictionWeight   float32
	ElasticityWeight float32
}

PhysicalProperties represent the physical properties of an object.

func (PhysicalProperties) Copy

func (p PhysicalProperties) Copy() PropValue

Copy returns a copy of the value.

func (PhysicalProperties) String

func (p PhysicalProperties) String() string

String returns a human-readable string representation of the value.

func (PhysicalProperties) Type

func (PhysicalProperties) Type() string

Type returns a string that identifies the type.

type PropValue

type PropValue interface {
	Value
	Copy() PropValue
}

PropValue is a Value that can be copied.

type ProtectedString

type ProtectedString string

ProtectedString indicates the source of a script.

func (ProtectedString) Copy

func (s ProtectedString) Copy() PropValue

Copy returns a copy of the value.

func (ProtectedString) String

func (s ProtectedString) String() string

String returns a human-readable string representation of the value.

func (ProtectedString) Stringlike

func (s ProtectedString) Stringlike() string

Stringlike returns the value as a string.

func (ProtectedString) Type

func (ProtectedString) Type() string

Type returns a string that identifies the type.

type Ray

type Ray struct {
	Origin    Vector3
	Direction Vector3
}

Ray is a line extending infinitely in one direction.

func (Ray) ClosestPoint

func (r Ray) ClosestPoint(point Vector3) Vector3

ClosestPoint returns the position on the ray that is nearest to *point*.

func (Ray) Copy

func (r Ray) Copy() PropValue

Copy returns a copy of the value.

func (Ray) Distance

func (r Ray) Distance(point Vector3) float64

Distance returns the distance between *point* and the point on the ray nearest to *point*.

func (Ray) String

func (r Ray) String() string

String returns a human-readable string representation of the value.

func (Ray) Type

func (Ray) Type() string

Type returns a string that identifies the type.

type Rect

type Rect struct {
	Min, Max Vector2
}

Rect represents an axis-aligned two-dimensional rectangle with a lower and upper boundary.

func (Rect) Copy

func (r Rect) Copy() PropValue

Copy returns a copy of the value.

func (Rect) Height

func (r Rect) Height() float64

Height returns the height of the rectangle.

func (Rect) String

func (r Rect) String() string

String returns a human-readable string representation of the value.

func (Rect) Type

func (Rect) Type() string

Type returns a string that identifies the type.

func (Rect) Width

func (r Rect) Width() float64

Width returns the width of the rectangle.

type Region3

type Region3 struct {
	Min, Max Vector3
}

Region3 represents an axis-aligned three-dimensional rectangular cuboid with a lower and upper boundary.

func (Region3) CFrame

func (r Region3) CFrame() CFrame

CFrame returns a CFrame with the default orientation, located at the center of the region.

func (Region3) Copy

func (r Region3) Copy() PropValue

Copy returns a copy of the value.

func (Region3) ExpandToGrid

func (r Region3) ExpandToGrid(res float64) Region3

ExpandToGrid returns the region expanded to align to the given resolution. If *res* is 0, the region is returned unchanged.

func (Region3) Size

func (r Region3) Size() Vector3

Size returns the size of the region.

func (Region3) String

func (r Region3) String() string

String returns a human-readable string representation of the value.

func (Region3) Type

func (Region3) Type() string

Type returns a string that identifies the type.

type Region3int16

type Region3int16 struct {
	Min, Max Vector3int16
}

Region3int16 represents an axis-aligned three-dimensional rectangular cuboid with a lower and upper boundary, with 16-bit integer precision.

func (Region3int16) Copy

func (r Region3int16) Copy() PropValue

Copy returns a copy of the value.

func (Region3int16) String

func (r Region3int16) String() string

String returns a human-readable string representation of the value.

func (Region3int16) Type

func (Region3int16) Type() string

Type returns a string that identifies the type.

type SharedString

type SharedString string

SharedString represents data that is shared by multiple objects.

func (SharedString) Copy

func (s SharedString) Copy() PropValue

Copy returns a copy of the value.

func (SharedString) String

func (s SharedString) String() string

String returns a human-readable string representation of the value.

func (SharedString) Stringlike

func (s SharedString) Stringlike() string

Stringlike returns the value as a string.

func (SharedString) Type

func (SharedString) Type() string

Type returns a string that identifies the type.

type String

type String string

String is a sequence of characters.

func (String) Copy

func (s String) Copy() PropValue

Copy returns a copy of the value.

func (String) String

func (s String) String() string

String returns a human-readable string representation of the value.

func (String) Stringlike

func (s String) Stringlike() string

Stringlike returns the value as a string.

func (String) Type

func (String) Type() string

Type returns a string that identifies the type.

type Stringer

type Stringer interface {
	Value
	String() string
}

Stringer is any Value that has a human-readable string representation.

type Stringlike

type Stringlike interface {
	Value
	Stringlike() string
}

Stringlike is any Value that can be converted to a string. Note that this is distinct from a Stringer, which returns the value in a human-readable format.

type Token

type Token uint32

Token represents the value of an enumerated type.

func (Token) Copy

func (t Token) Copy() PropValue

Copy returns a copy of the value.

func (Token) Intlike

func (t Token) Intlike() int64

Intlike returns the value as an integer.

func (Token) Numberlike

func (t Token) Numberlike() float64

Numberlike returns the value as a float.

func (Token) String

func (t Token) String() string

String returns a human-readable string representation of the value.

func (Token) Type

func (Token) Type() string

Type returns a string that identifies the type.

type UDim

type UDim struct {
	Scale  float32
	Offset int32
}

UDim represents one dimension with a dynamic and constant component.

func (UDim) Add

func (u UDim) Add(v UDim) UDim

Adds returns the sum of two UDims.

func (UDim) Copy

func (u UDim) Copy() PropValue

Copy returns a copy of the value.

func (UDim) Neg

func (u UDim) Neg() UDim

Neg returns the negation of the UDim.

func (UDim) String

func (u UDim) String() string

String returns a human-readable string representation of the value.

func (UDim) Sub

func (u UDim) Sub(v UDim) UDim

Sub returns the difference of two UDims.

func (UDim) Type

func (UDim) Type() string

Type returns a string that identifies the type.

type UDim2

type UDim2 struct {
	X, Y UDim
}

UDim2 is a UDim on two dimensions.

func (UDim2) Add

func (u UDim2) Add(v UDim2) UDim2

Add returns the sum of two UDim2s.

func (UDim2) Copy

func (u UDim2) Copy() PropValue

Copy returns a copy of the value.

func (UDim2) Lerp

func (u UDim2) Lerp(goal UDim2, alpha float64) UDim2

Lerp returns a UDim2 linearly interpolated from the UDim2 to *goal* according to *alpha*, which has an interval of [0, 1].

func (UDim2) Neg

func (u UDim2) Neg() UDim2

Neg returns the negation of the UDim2.

func (UDim2) String

func (u UDim2) String() string

String returns a human-readable string representation of the value.

func (UDim2) Sub

func (u UDim2) Sub(v UDim2) UDim2

Sub returns the difference of two UDim2s.

func (UDim2) Type

func (UDim2) Type() string

Type returns a string that identifies the type.

type Value

type Value interface {
	Type() string
}

Value is a value that has a type.

type Vector2

type Vector2 struct {
	X, Y float32
}

Vector2 is a two-dimensional Euclidean vector.

func NewVector2

func NewVector2(x, y float64) Vector2

NewVector2 returns a vector initialized with the given components.

func (Vector2) Add

func (v Vector2) Add(op Vector2) Vector2

Add returns the sum of two vectors.

func (Vector2) Copy

func (v Vector2) Copy() PropValue

Copy returns a copy of the value.

func (Vector2) Cross

func (v Vector2) Cross(op Vector2) float64

Cross returns the cross product of two vectors extended into three dimensions with z components of 0.

func (Vector2) Div

func (v Vector2) Div(op Vector2) Vector2

Div returns the quotient of two vectors.

func (Vector2) DivN

func (v Vector2) DivN(op float64) Vector2

DivN returns a Vector2 with each component divided by a number.

func (Vector2) Dot

func (v Vector2) Dot(op Vector2) float64

Dot returns the dot product of two vectors.

func (Vector2) FuzzyEq

func (v Vector2) FuzzyEq(op Vector2, epsilon float64) bool

FuzzyEq returns whether the two vectors are approximately equal.

func (Vector2) Lerp

func (v Vector2) Lerp(goal Vector2, alpha float64) Vector2

Lerp returns a Vector2 linearly interpolated from the Vector2 to *goal* according to *alpha*, which has an interval of [0, 1].

func (Vector2) Magnitude

func (v Vector2) Magnitude() float64

Magnitude returns the length of the vector.

func (Vector2) Mul

func (v Vector2) Mul(op Vector2) Vector2

Mul returns the product of two vectors.

func (Vector2) MulN

func (v Vector2) MulN(op float64) Vector2

MulN returns the vector with each component multiplied by a number.

func (Vector2) Neg

func (v Vector2) Neg() Vector2

Neg returns the negation of the vector.

func (Vector2) String

func (v Vector2) String() string

String returns a human-readable string representation of the value.

func (Vector2) Sub

func (v Vector2) Sub(op Vector2) Vector2

Sub returns the difference of two vectors.

func (Vector2) Type

func (Vector2) Type() string

Type returns a string that identifies the type.

func (Vector2) Unit

func (v Vector2) Unit() Vector2

Unit returns the vector with the same direction and a length of 1.

type Vector2int16

type Vector2int16 struct {
	X, Y int16
}

Vector2int16 is a two-dimensional Euclidean vector with 16-bit integer precision.

func NewVector2int16

func NewVector2int16(x, y int) Vector2int16

NewVector2int16 returns a vector initialized with the given components.

func (Vector2int16) Add

Add returns the sum of two vectors.

func (Vector2int16) Copy

func (v Vector2int16) Copy() PropValue

Copy returns a copy of the value.

func (Vector2int16) Div

Div returns the quotient of two vectors.

func (Vector2int16) DivN

func (v Vector2int16) DivN(op float64) Vector2int16

DivN returns the vector with each component divided by a number.

func (Vector2int16) Mul

Mul returns the product of two vectors.

func (Vector2int16) MulN

func (v Vector2int16) MulN(op float64) Vector2int16

MulN returns the vector with each component multiplied by a number.

func (Vector2int16) Neg

func (v Vector2int16) Neg() Vector2int16

Neg returns the negation of the vector.

func (Vector2int16) String

func (v Vector2int16) String() string

String returns a human-readable string representation of the value.

func (Vector2int16) Sub

Sub returns the difference of two vectors.

func (Vector2int16) Type

func (Vector2int16) Type() string

Type returns a string that identifies the type.

type Vector3

type Vector3 struct {
	X, Y, Z float32
}

Vector3 is a three-dimensional Euclidean vector.

func NewVector3

func NewVector3(x, y, z float64) Vector3

NewVector3 returns a vector initialized with the given components.

func NewVector3FromAxis

func NewVector3FromAxis(axis Axis) Vector3

NewVector3FromAxis returns the vector that corresponds to the given Axis.

func NewVector3FromFace

func NewVector3FromFace(normal Face) Vector3

NewVector3FromFace returns the vector that corresponds to the given Face.

func (Vector3) Add

func (v Vector3) Add(op Vector3) Vector3

Add returns the sum of two vectors.

func (Vector3) Copy

func (v Vector3) Copy() PropValue

Copy returns a copy of the value.

func (Vector3) Cross

func (v Vector3) Cross(op Vector3) Vector3

Cross returns the cross product of two vectors.

func (Vector3) Div

func (v Vector3) Div(op Vector3) Vector3

Div returns the quotient of two vectors.

func (Vector3) DivN

func (v Vector3) DivN(op float64) Vector3

DivN returns the vector with each component divided by a number.

func (Vector3) Dot

func (v Vector3) Dot(op Vector3) float64

Dot returns the dot product of two vectors.

func (Vector3) FuzzyEq

func (v Vector3) FuzzyEq(op Vector3, epsilon float64) bool

FuzzyEq returns whether the two vectors are approximately equal.

func (Vector3) Lerp

func (v Vector3) Lerp(goal Vector3, alpha float64) Vector3

Lerp returns a Vector3 linearly interpolated from the Vector3 to *goal* according to *alpha*, which has an interval of [0, 1].

func (Vector3) Magnitude

func (v Vector3) Magnitude() float64

Magnitude returns the length of the vector.

func (Vector3) Mul

func (v Vector3) Mul(op Vector3) Vector3

Mul returns the product of two vectors.

func (Vector3) MulN

func (v Vector3) MulN(op float64) Vector3

MulN returns the vector with each component multiplied by a number.

func (Vector3) Neg

func (v Vector3) Neg() Vector3

Neg returns the negation of the vector.

func (Vector3) String

func (v Vector3) String() string

String returns a human-readable string representation of the value.

func (Vector3) Sub

func (v Vector3) Sub(op Vector3) Vector3

Sub returns the difference of two vectors.

func (Vector3) Type

func (Vector3) Type() string

Type returns a string that identifies the type.

func (Vector3) Unit

func (v Vector3) Unit() Vector3

Unit returns the vector with the same direction and a length of 1.

type Vector3int16

type Vector3int16 struct {
	X, Y, Z int16
}

Vector3int16 is a three-dimensional Euclidean vector with 16-bit integer precision.

func NewVector3int16

func NewVector3int16(x, y, z int) Vector3int16

NewVector3int16 returns a vector initialized with the given components.

func (Vector3int16) Add

Add returns the sum of two vectors.

func (Vector3int16) Copy

func (v Vector3int16) Copy() PropValue

Copy returns a copy of the value.

func (Vector3int16) Div

Div returns the quotient of two vectors.

func (Vector3int16) DivN

func (v Vector3int16) DivN(op float64) Vector3int16

DivN returns the vector with each component divided by a number.

func (Vector3int16) Mul

Mul returns the product of two vectors.

func (Vector3int16) MulN

func (v Vector3int16) MulN(op float64) Vector3int16

MulN returns the vector with each component multiplied by a number.

func (Vector3int16) Neg

func (v Vector3int16) Neg() Vector3int16

Neg returns the negation of the vector.

func (Vector3int16) String

func (v Vector3int16) String() string

String returns a human-readable string representation of the value.

func (Vector3int16) Sub

Sub returns the difference of two vectors.

func (Vector3int16) Type

func (Vector3int16) Type() string

Type returns a string that identifies the type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL