public final class Mesh extends java.lang.Object implements IDestroyable, java.lang.Cloneable, java.lang.Comparable<Mesh>, ITransformable, ITree<Mesh>, ICullableNode
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
name
Mesh name
|
| Constructor and Description |
|---|
Mesh() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Mesh mesh) |
void |
addGeometry(GeometryData geometry) |
int |
compareTo(Mesh o) |
void |
destroy(IGLApi glApi) |
Mesh |
duplicate(boolean duplicateHierarchy,
boolean duplicateAnimation,
boolean duplicateMaterialKey) |
Mesh |
getChild(int index) |
Array<Mesh> |
getChilds() |
java.lang.Iterable<? extends ICullable> |
getCullableNodes() |
Array<GeometryData> |
getGeometries() |
java.lang.String |
getLinkToJoint() |
Mat4x4 |
getMatrix() |
Mat4x4 |
getMatrix(Mat4x4 dst) |
int |
getNumChilds() |
int |
getNumFaces() |
int |
getNumGeometries() |
int |
getNumIndices() |
int |
getNumVertices() |
Transform |
getTransform() |
Transform |
getTransform(Transform dst) |
KeyFrame<Transform> |
getTransforms() |
IVolume<?> |
getVolume(int bvOptions)
By default the bounding box do not includes sub meshes (
childs),
to includes sub meshes uses this flag : VolumeOptions#BV_SUB_OBJECTSBy default, all model/meshes are included in the bounding box even invisible object. |
boolean |
isCulled() |
boolean |
isDrawBoundingVolume() |
boolean |
isLinkedToJoint() |
boolean |
isVisible() |
boolean |
isVisibleAndNotCulled() |
void |
onAnimationChanged()
This method must be called when
transforms has been manually modified (add, remove, clear, null, ...). |
void |
onHierarchyChanged()
This method must be called when
childs has been manually modified (add, remove, clear, ...). |
boolean |
removeChild(Mesh mesh) |
boolean |
removeGeometry(GeometryData geometry) |
Array<Mesh> |
setChilds(Array<Mesh> childs) |
void |
setCulled(boolean culled) |
void |
setDrawBoundingVolume(boolean drawBoundingVolume) |
Array<GeometryData> |
setGeometries(Array<GeometryData> geometries) |
void |
setLinkToJoint(java.lang.String jointName)
|
void |
setTransform(Transform src) |
void |
setTransforms(KeyFrame<Transform> keyFrame) |
void |
setVisible(boolean visible) |
java.lang.String |
toString() |
void |
transform(Transform transform)
Post multiply by the transform specified
|
void |
useTangents(boolean[] useTangents)
Deprecated.
|
public final java.lang.String toString()
toString in class java.lang.Objectpublic final int compareTo(Mesh o)
compareTo in interface java.lang.Comparable<Mesh>public Mesh duplicate(boolean duplicateHierarchy, boolean duplicateAnimation, boolean duplicateMaterialKey)
duplicateHierarchy - duplicateAnimation - used if parameter duplicateHierarchy is trueduplicateMaterialKey - used if parameter duplicateHierarchy is trueMeshpublic final void destroy(IGLApi glApi)
destroy in interface IDestroyablepublic final int getNumChilds()
getNumChilds in interface ITree<Mesh>public final void addChild(Mesh mesh)
public final boolean removeChild(Mesh mesh)
public final Mesh getChild(int index)
getChild in interface ITree<Mesh>index - in the range [0; ITree.getNumChilds()[public final Array<Mesh> setChilds(Array<Mesh> childs)
childs - public final int getNumGeometries()
Mesh.public final void addGeometry(GeometryData geometry)
geometry - new GeometryData to add this this Meshpublic final boolean removeGeometry(GeometryData geometry)
geometry - a GeometryData to removeGeometryData has been removed from this Meshpublic final Array<GeometryData> getGeometries()
public final Array<GeometryData> setGeometries(Array<GeometryData> geometries)
geometries - public int getNumFaces()
this mesh.public int getNumIndices()
this mesh.public int getNumVertices()
this mesh. This is equivalent to vertices.positions.lengthpublic final java.lang.Iterable<? extends ICullable> getCullableNodes()
getCullableNodes in interface ICullableNodepublic final Mat4x4 getMatrix(Mat4x4 dst)
getMatrix in interface ICullableNodedst - destination Mat4x4 to store local matrixpublic final boolean isLinkedToJoint()
Mesh is linked to a Joint.getLinkToJoint(),
setLinkToJoint(String)public final java.lang.String getLinkToJoint()
Joint name the Mesh is linked to, or nullsetLinkToJoint(String)public final void setLinkToJoint(java.lang.String jointName)
jointName - a Joint namepublic final Transform getTransform(Transform dst)
getTransform in interface ITransformabledst - destination Transform to store local transformpublic final void setTransform(Transform src)
setTransform in interface ITransformablepublic final Transform getTransform()
Mesh, or null if identitypublic final void transform(Transform transform)
transform in interface ITransformablepublic IVolume<?> getVolume(int bvOptions)
childs),
to includes sub meshes uses this flag : VolumeOptions#BV_SUB_OBJECTSgetVolume in interface IBoundablebvOptions - bounding volume options.BoundingBox or BoundingSphere depending on options.VolumeOptions,
Box,
Sphere,
Cylinder,
Capsulepublic final void onAnimationChanged()
transforms has been manually modified (add, remove, clear, null, ...).public final void onHierarchyChanged()
childs has been manually modified (add, remove, clear, ...).@Deprecated public final void useTangents(boolean[] useTangents)
public final boolean isVisibleAndNotCulled()
public final boolean isVisible()
isVisible in interface ICullableGeometryData is visiblepublic final void setVisible(boolean visible)
visible - set new visibility state of this GeometryDatapublic final boolean isCulled()
isCulled in interface ICullableGeometryData is culled (by visibility algorithm, ...)public final void setCulled(boolean culled)
setCulled in interface ICullableculled - new culled state for this GeometryDatapublic final boolean isDrawBoundingVolume()
GeometryDatapublic final void setDrawBoundingVolume(boolean drawBoundingVolume)
Bonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com