Vec3
A 3 dimensional vector object.
In many instances a Vec3 will be accessible from Nape which is marked
as immutable, these cases will be documented and modifying such a Vec3
will result in an error.
Static Members
Allocate a Vec3 from the global object pool.
Use of this method should always be preferred to the constructor.
Name | Type | Default | Description |
---|---|---|---|
x |
Float | 0 |
The x component of Vec3. (default 0) |
y |
Float | 0 |
The y component of Vec3. (default 0) |
z |
Float | 0 |
The z component of Vec3. (default 0) |
Returns | Description |
---|---|
Vec3 | A Vec3 allocated from global object pool with given components. |
Instance Members
@private
@private
@private
The x component of Vec3. @default 0
The y component of Vec3. @default 0
The z component of Vec3. @default 0
Length of Vec3.
This value may also be set to any value including negatives, though
an error will be thrown if length of the Vec3 is already 0 as such
a scaling would be undefined. As well as if this Vec3 has been disposed
of, or is immutable.
@default 0
Produce a copy of this Vec3.
public function copy():Vec3{ { #if(!NAPE_RELEASE_BUILD) if(this!=null&&this.zpp_disp)throw "Error: "+"Vec3"+" has been disposed and cannot be used!"; #end }; return Vec3.get(x,y,z); } /** Release Vec3 object to global object pool.
Compute squared length of Vec3.
Returns | Description |
---|---|
Float | The squared length of this Vec3. |
Set values of this Vec3 from another.
Name | Type | Description |
---|---|---|
vector |
Vec3 | The vector to set values from. |
Returns | Description |
---|---|
Vec3 | A reference to this Vec3. |
Set values of this Vec3 from numbers.
Name | Type | Description |
---|---|---|
x |
Float | The new x component value for this vector. |
y |
Float | The new y component value for this vector. |
z |
Float | The new z component value for this vector. |
Returns | Description |
---|---|
Vec3 | A reference to this Vec3. |
Produce copy of the xy components of Vec3.
This function will return a new Vec2 completely seperate
from this Vec3 with values equal to the xy components of
this Vec3.
Name | Type | Default | Description |
---|---|---|---|
weak |
Bool | false |
If true, then the allocated Vec2 will be weak so that when used as an argument to a Nape function it will be automatically released back to the global object pool. (default false) |
Returns | Description |
---|---|
Vec2 | An allocated Vec2 representing the xy components of this vector. |
@private
Returns |
---|
String |
Construct a new Vec3.
This method should not generally be used with preference for the
static get method which will make use of the global object pool.
Name | Type | Default | Description |
---|---|---|---|
x |
Float | 0 |
The x component of Vec3. (default 0) |
y |
Float | 0 |
The y component of Vec3. (default 0) |
z |
Float | 0 |
The z component of Vec3. (default 0) |
Private Members
Metadata
Name | Parameters |
---|---|
:final |
- |