Constructor
new L3D.Geometry()
Properties
The list of attributes for this geometry.
The list of meshes that belong to this geometry.
The number of attributes for this geometry.
The number of mesh primitives for this geometry.
The number of point groups.
The number of points in the geometry.
The number of primitive groups.
The number of primitives.
The points of the geometry
The list of primitives for this geometry.
Methods
accelAttribute(addAttr)
Return the acceleration attribute (accel). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
addFloatAttribute(name)
Add a new double point attribute with the given name and default value.
name |
String |
addIntAttribute(name)
Add a new integer point attribute with the given name and default value.
name |
String |
addPointGroup(name) → PointGroup
Add a new point group.
name |
String |
addPoints(count)
Add a number of points to the Geometry.
count |
number |
addPrimitive(primitive)
Add a Primitive.
primitive |
GeometryPrimitive |
addPrimitiveGroup(name)
Add a new primitive group.
name |
String |
addVec2Attribute(name)
Add a new vector2 point attribute with the given name and default value.
name |
String |
addVec3Attribute(name)
Add a new vector3 point attribute with the given name and default value.
name |
String |
addVec4Attribute(name)
Add a new vector4 point attribute with the given name and default value.
name |
String |
append(other)
Append the contents of another Geometry to this.
other |
Geometry |
clear()
Reset the geometry, clearing out all data.
colorAttribute(addAttr)
Return the color attribute (Cd). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
copy(other, pointsOnly)
Copy geometry from [other] into this geometry.
other |
Geometry | |
pointsOnly |
bool |
copyAttribute(other, newName)
Add a copy of the given attribute to this geometry.
other |
GeometryAttribute | The attribute to make a copy of |
newName |
String | Optional new name for the attribute. Otherwise the other attribute's name will be used. This does not check for conflicts with attributes that already have that name. |
findAttribute(name) → nullable GeometryAttribute
Return the attribute with the given name.
name |
String |
- GeometryAttribute
Returns null if the attribute couldn't be found.
findPointGroup(name) → nullable PointGroup
Find a point group with the given name.
name |
String |
findPrimitiveById(id) → nullable GeometryPrimitive
Find a primitive with the given id.
id |
number | The primitive id to find. |
- GeometryPrimitive
The primitive with the given id, null if none was found.
findPrimitiveGroup(name) → nullable PrimitiveGroup
Find a primitive group with the given name.
name |
String |
generateNormals()
Compute surface normals for the geometry.
generateTangents()
Compute surface tangents for the geometry.
getAttribute(index)
Returns the attribute at the given index.
index |
number |
getBoundingBox()
Return the bounding box encapsulating the geometry. The value is cached and will only be recomputed if the geometry points are modified.
getMesh(index) → nullable Mesh
Get a mesh primitive.
index |
number |
- Mesh
getPoint(index, out) → Vector3
Get a points position
index |
number | |
out |
Vector3 |
getPointGroup(index) → PointGroup
Get a point group.
index |
number |
getPrimitive(index) → nullable GeometryPrimitive
Get a primitive.
index |
number |
getPrimitiveGroup(index) → nullable PrimitiveGroup
Get a primitive group.
index |
number |
lifeAttribute(addAttr)
Return the life attribute (life). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
normalAttribute(addAttr)
Return the normal attribute (N). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
pstateAttribute(addAttr)
Return the pstate attribute (pstate). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
rayIntersect(ray, rayHit) → bool
Test for a ray intersection with this geometry.
ray |
Ray | |
rayHit |
RayHitInfo |
- bool
removeAttribute(name)
Remove a point attribute.
name |
String |
removePointRange(index, count)
Remove a range of points from the geometry.
index |
number | |
count |
number |
removePoints(toRemove)
Remove a list of points.
toRemove |
* |
renameAttribute(from, to)
Rename an attribute.
from |
String | |
to |
String |
resetBoundingBox()
Reset the bounding box to force it to be recomputed next time it's requested.
resetRayAccel()
Reset the ray accel structures, if any.
setPoint(index, p_x, y, z)
Set a point's position
index |
number | |
p_x |
* | |
y |
number | |
z |
number |
tangentAttribute(addAttr)
Return the tangent attribute (T). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
texture2Attribute(addAttr)
Return the texture2 attribute (uv2). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
textureAttribute(addAttr)
Return the texture attribute (uv). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
translatePoint(index, delta)
Add to a points position
index |
number | |
delta |
Vector3 |
updateBoundingBox()
Compute the bounding box of the geometry.
updateRayAccel()
Generate ray accel structures for the geometry and mesh primitives
velocityAttribute(addAttr)
Return the velocity attribute (v). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
weightAttribute(addAttr)
Return the weight attribute (w). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |