Mat3 Class

Extends ValueType

Module: cc Parent Module: cc

Mathematical 3x3 matrix.

NOTE: we use column-major matrix for all matrix calculation.

This may lead to some confusion when referencing OpenGL documentation, however, which represents out all matricies in column-major format. This means that while in code a matrix may be typed out as:

[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 0]

The same matrix in the OpenGL documentation is written as:

1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 0

Please rest assured, however, that they are the same thing! This is not unique to glMatrix, either, as OpenGL developers have long been confused by the apparent lack of consistency between the memory layout and the documentation.

Index

Properties
  • IDENTITY Mat3 Identity of Mat3
  • m Float64Array | Float32Array Matrix Data
Methods
  • toArray Matrix transpose array
  • fromArray Transfer matrix array
  • constructor
  • clone This method returns an exact copy of current value.
  • equals Compares this object with the other one.
  • lerp Linearly interpolates between this value to to value by ratio which is in the range [0, 1].
  • set Copys all the properties from another given object to this value.
  • toString Convert to a readable string.

Details

Properties

IDENTITY

Identity of Mat3

meta description
Type Mat3
Defined in cocos2d/core/value-types/mat3.ts:43
m

Matrix Data

meta description
Type Float64Array | Float32Array
Defined in cocos2d/core/value-types/mat3.ts:836

Methods

toArray

Matrix transpose array

meta description
Defined in cocos2d/core/value-types/mat3.ts:802
Parameters
  • ofs Unknown 数组内的起始偏移量
fromArray

Transfer matrix array

meta description
Defined in cocos2d/core/value-types/mat3.ts:819
Parameters
  • ofs Unknown 数组起始偏移量
constructor
meta description
Defined in cocos2d/core/value-types/mat3.ts:844
clone

This method returns an exact copy of current value.

meta description
Returns ValueType
Defined in cocos2d/core/value-types/value-type.ts:39
equals

Compares this object with the other one.

meta description
Returns Boolean
Defined in cocos2d/core/value-types/value-type.ts:51
Parameters
lerp

Linearly interpolates between this value to to value by ratio which is in the range [0, 1]. When ratio = 0 returns this. When ratio = 1 return to. When ratio = 0.5 returns the average of this and to.

meta description
Returns ValueType
Defined in cocos2d/core/value-types/value-type.ts:63
Parameters
set

Copys all the properties from another given object to this value.

meta description
Defined in cocos2d/core/value-types/value-type.ts:80
Parameters
toString

Convert to a readable string.

meta description
Returns string
Defined in cocos2d/core/value-types/value-type.ts:92

results matching ""

    No results matching ""