Constructor
new L3D.MeshPrimitive()
Extends
Properties
- Overrides:
The index of the mateiral to use when the object has multiple materials.
The number of vertex attributes.
Methods
_intersectTriangle(p0, p1, p2, ray, rayHit, hitDistance) → bool
Test a ray against an individual triangle.
p0 |
Vector3 | |
p1 |
Vector3 | |
p2 |
Vector3 | |
ray |
Ray | |
rayHit |
RayHitInfo | |
hitDistance |
number |
- bool
_intersectTriangleFan()
Ray intersection test with a triangle_fan mesh
_intersectTriangles()
Ray intersection test with a triangle mesh
_intersectTriangleStrip()
Ray intersection test with a triangle_strip mesh
addFloatAttribute(name)
Add a new double vertex attribute with the given name and default value.
name |
String |
addIntAttribute(name)
Add a new integer vertex attribute with the given name and default value.
name |
String |
addVec2Attribute(name)
Add a new vector2 vertex attribute with the given name and default value.
name |
String |
addVec3Attribute(name)
Add a new vector3 vertex attribute with the given name and default value.
name |
String |
addVec4Attribute(name)
Add a new vector4 vertex attribute with the given name and default value.
name |
String |
attribute(index)
Get a vertex attribute.
index |
number |
colorAttribute(addAttr)
Return the color attribute (Cd). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
copyAttribute(other, newName)
Add a new vertex attribute that is a copy of [other], possibly setting a [newName] for it.
other |
* | |
newName |
* |
findAttribute(name)
Find a vertex attribute with the given name.
name |
String |
getAllAttributeNames(geom)
Get the union of vertex and point attribute names. The returned Map will use the attribute name as the key, and the value will be 0 if it's a point attribute and 1 if it's a vertex attribute.
geom |
Geometry |
getBoundingBox(geom, box)
- Overrides:
Compute and return the bounding box of the primitive.
geom |
Geometry | |
box |
BoundingBox |
getPoint(geom, index, out)
- Overrides:
Return a point of the primitive.
geom |
Geometry | |
index |
number | |
out |
Vector3 |
getPolyVertices(fi, verts, vertIndexes)
Returns the vertices for a given face [fi].
fi |
number | |
verts |
Array | |
vertIndexes |
Array |
interpolateAttribute()
Return the interpolated attribute value given the point of a ray intersection on the mesh.
normalAttribute(addAttr)
Return the normal attribute (N). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
rayIntersect(geom, ray, rayHit, triangle) → bool
- Overrides:
Test for a ray intersection with this mesh.
geom |
Geometry | The geometry that owns this mesh. |
ray |
Ray | The ray to test |
rayHit |
RayHitInfo | Storage for the results of the intersection. |
triangle |
int | Optionally intersect a specific triangle |
- bool
Whether or not there was an intersection.
removeAttribute(name)
Remove a vertex attribute.
name |
String |
renameAttribute(from, to)
Rename a vertex attribute
from |
String | |
to |
String |
setPoint(geom, index, p)
- Overrides:
Set a point of the primitive.
geom |
Geometry | |
index |
number | |
p |
Vector3 |
textureAttribute(addAttr)
Return the texture attribute (uv). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |
transformBy(geom, t)
- Overrides:
If the primitive requires any additional transformation beyond just transforming the points, the transformation can be applied here.
geom |
Geometry | |
t |
Matrix4 |
weightAttribute(addAttr)
Return the weight attribute (w). If addAttr is true and the attribute doesn't exist, it will be created.
addAttr |
bool |