|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.rico.engine.geometry.AbstractMesh
public abstract class AbstractMesh
Abstract class that represents a mesh
Constructor Summary | |
---|---|
AbstractMesh(boolean smooth)
Creates a new mesh object, optionally smooth shaded. |
|
AbstractMesh(boolean smooth,
BoundingVolume type)
Creates a new mesh object, optionally smooth shaded. |
Method Summary | |
---|---|
void |
addShader(ShaderIface shader)
Deprecated. does not really work correctly in general ;-) |
abstract void |
destroy()
Destroys the mesh. |
abstract void |
draw(javax.media.opengl.GL gl)
Call this method to draw the mesh. |
void |
drawShaders(javax.media.opengl.GL gl)
Deprecated. does not really work correctly in general ;-) |
BoundingVolumeIface |
getBoundingVolume()
Returns the bounding volume of the mesh, if it's set. |
abstract java.util.List<Triangle> |
getFaces()
Returns the faces of the mesh relative to the (0f,0f,0f) origin, i.e. the position, rotation or scale factor of the mesh is not taken into account for the faces. |
abstract java.util.List<Triangle> |
getFacesTransformed()
Returns the face with coordinates that are correctly transformed (translation, rotation, scale factor) according to the current transformation state of the mesh. |
float |
getHeightOffset()
Returns the height offset of the mesh that it would have over the ground mesh. |
Material |
getMaterial()
Returns the current material of the mesh |
Point3D |
getMouseOverMesh(int screenX,
int screenY)
Convenience method to get the 3D position of the mouse, if the mouse is currently located over the mesh (resp. its bounding volume). |
java.lang.String |
getName()
Returns the name of the mesh. |
Point3D |
getPosition()
Returns the current Position of the mesh as a copy. |
float |
getPosX()
Returns the x-coordinate of the mesh's position |
float |
getPosY()
Returns the y-coordinate of the mesh's position |
float |
getPosZ()
Returns the z-coordinate of the mesh's position |
Point3D |
getRotation()
Returns the degrees of roation of this mesh as an instance of Point3D. |
float |
getRotX()
Returns the degree of rotation around the x-axis of the mesh |
float |
getRotY()
Returns the degree of rotation around the y-axis of the mesh |
float |
getRotZ()
Returns the degree of rotation around the z-axis of the mesh |
float |
getScaleX()
Returns the scale factor for the x-axis |
float |
getScaleY()
Returns the scale factor for the y-axis |
float |
getScaleZ()
Returns the scale factor for the z-axis |
java.lang.String |
getTex0Path()
Returns the file path to the image that is used for texture unit 0. |
java.lang.String |
getTex1Path()
Returns the file path to the image that is used for texture unit 1. |
float |
getText0XMovement()
Returns the texture movement of tex unit 0 in x direction. |
float |
getText0YMovement()
Returns the texture movement of tex unit 0 in y direction. |
float |
getText1XMovement()
Returns the texture movement of tex unit 1 in x direction. |
float |
getText1YMovement()
Returns the texture movement of tex unit 1 in y direction. |
com.sun.opengl.util.texture.Texture |
getTexUnit0()
Returns the current base texture of this mesh at texture unit 0 |
com.sun.opengl.util.texture.Texture |
getTexUnit1()
Returns the current texture of this mesh at texture unit 1 |
boolean |
isCollidable()
Determines whether or not this mesh is meant to be collidable. |
boolean |
isDrawingEnabled()
Determines whether or not the mesh is needed to be drawn. |
boolean |
isEnabledOcclusionCulling()
Determines whether or not occlusion culling is enabled for this mesh. |
boolean |
isMouseOverMesh(int screenX,
int screenY)
Convenience method to check if the mouse is currently located over the mesh (resp. its bounding volume). |
boolean |
isOccluded()
Determines whether or not this mesh is occluded by another one. |
boolean |
isPickable()
Determines whethter or not the mesh is pickable by a picking method (OpenGL internal picking or ray picking). |
boolean |
isShadowEnabled()
Determines whether the shadow of this mesh ought to be drawn. |
boolean |
isSmoothShaded()
Determines whether the mesh is beeing smoothly shaded. |
boolean |
isTex0Flipped()
Determines whether or not the texture at texture unit 0 was flipped initially. |
boolean |
isTex0MipMapped()
Determines whether or not the texture at texture unit 0 was mip mapped initially. |
boolean |
isTex0Rotated()
Determines whether or not the texture at texture unit 0 was rotated initially. |
boolean |
isTex1Flipped()
Determines whether or not the texture at texture unit 1 was flipped initially. |
boolean |
isTex1MipMapped()
Determines whether or not the texture at texture unit 1 was mip mapped initially. |
boolean |
isTex1Rotated()
Determines whether or not the texture at texture unit 1 was rotated initially. |
void |
moveBackwardsGlobal(float delta,
long elapsedTime)
Moves the mesh to backward direction based on the global initial OpenGL coordinate system alignment. |
void |
moveBackwardsLocal(float delta,
long elapsedTime)
Moves the mesh to backward direction based on its current rotation. |
void |
moveDownGlobal(float delta,
long elapsedTime)
Moves the mesh to down based on the global initial OpenGL coordinate system alignment. |
void |
moveForwardGlobal(float delta,
long elapsedTime)
Moves the mesh to forward direction based on the global initial OpenGL coordinate system alignment |
void |
moveForwardLocal(float delta,
long elapsedTime)
Moves the mesh to forward direction based on its current rotation. |
void |
moveLeftGlobal(float delta,
long elapsedTime)
Moves the mesh to the left based on the global initial OpenGL coordinate system alignment. |
void |
moveLeftLocal(float delta,
long elapsedTime)
Moves the mesh to the left based on its current rotation. |
void |
moveRightGlobal(float delta,
long elapsedTime)
Moves the mesh to the right based on the global initial OpenGL coordinate system alignment. |
void |
moveRightLocal(float delta,
long elapsedTime)
Moves the mesh to the right based on its current rotation. |
void |
moveTo(float x,
float z,
float speedMove,
float speedRot,
long elapsedTime)
Moves the mesh towards the specified coordinates |
void |
moveUpGlobal(float delta,
long elapsedTime)
Moves the mesh to up based on the global initial OpenGL coordinate system alignment. |
void |
performTransformations(javax.media.opengl.GL gl)
This method performs all translations, rotations and scalings for the mesh. |
void |
rotateDown(float delta,
long elapsedTime)
Rotates the mesh down. |
void |
rotateLeft(float delta,
long elapsedTime)
Rotates the mesh to the left. |
void |
rotateRight(float delta,
long elapsedTime)
Rotates the mesh to the right. |
void |
rotateUp(float delta,
long elapsedTime)
Rotates the mesh up. |
void |
scale(float x,
float y,
float z)
Scales the mesh to the specified x-, y-, z-values along its axxises Note: Do not provide a paramter which is equal to 0! |
void |
setAttachedGround(AbstractGroundMesh ground)
Attaches the mesh to the ground. |
void |
setBlendDestFactor(BlendDestFactor destFact)
Sets the destination factor for the OpenGL blending function |
void |
setBlendFunction(BlendSourceFactor srcFact,
BlendDestFactor destFact)
Sets the source and destination factors for the OpenGL blending function. |
void |
setBlendSourceFactor(BlendSourceFactor srcFact)
Sets the source factor for the OpenGL blending function |
void |
setCollidable(boolean collidable)
Sets a flag to signal whether or not this mesh is meant to be collidable. |
void |
setDrawingEnabled(boolean draw)
Sets whether or not the mesh should be drawn. |
void |
setEnabledOcclusionCulling(boolean enable)
Sets the occluision culling mechanism enabled or disabled for this mesh. |
void |
setEnvironmentMap(EnvironmentMappingIface envirMap)
Adds an environment map to the mesh. |
void |
setMaterial(Material material)
Sets the material of the mesh to the specified material. |
void |
setName(java.lang.String name)
Sets the (optional) name of this mesh. |
void |
setPickable(boolean pick)
Sets whethter or not the mesh is pickable |
void |
setPosition(float x,
float y,
float z)
Sets the position of the mesh by the three given parameters |
void |
setPosition(Point3D position)
Sets the position of the mesh with a Point3D object |
void |
setPosX(float x)
Sets the x-coordinate of this mesh's position |
void |
setPosY(float y)
Sets the y-coordinate of this mesh's position |
void |
setPosZ(float z)
Sets the z-coordinate of this mesh's position |
void |
setRotation(float degX,
float degY,
float degZ)
Sets the rotation of the mesh around its x-,y- and z-axis. |
void |
setRotation(Point3D rot)
Sets the rotation of the mesh according to the values of the specified rotation vector. |
void |
setRotX(float degrees)
Sets the rotation of the mesh around its x-axis |
void |
setRotY(float degrees)
Sets the rotation of the mesh around its y-axis |
void |
setRotZ(float degrees)
Sets the rotation of the mesh around its z-axis |
void |
setScaleX(float x)
Set the scale factor for the x-axis of the mesh. |
void |
setScaleY(float y)
Set the scale factor for the y-axis of the mesh. |
void |
setScaleZ(float z)
Set the scale factor for the z-axis of the mesh. |
void |
setShadowEnabled(boolean enable)
Sets whether the shadow of this mesh ought to be drawn |
void |
setShowBoundingVolume(boolean show)
Determines wheter the bounding volume shall be visually shown. |
void |
setTex0Movement(float moveX,
float moveY)
Set texture movement on texture unit 0 in x and y direction. |
void |
setTex0TexEnvirMode(TexEnvirMode mode,
float[] color)
Sets the texture environment mode and the texture environment color for texture unit 0. |
void |
setTex0XMovement(float dis)
Set texture movement on texture unit 0 in x direction |
void |
setTex0YMovement(float dis)
Set texture movement on texture unit 0 in y direction |
void |
setTex1Movement(float moveX,
float moveY)
Set texture movement on texture unit 0 in x and y direction. |
void |
setTex1TexEnvirMode(TexEnvirMode mode,
float[] color)
Sets the texture environment mode and the texture environment color for texture unit 1. |
void |
setTex1XMovement(float dis)
Set texture movement on texture unit 0 in x direction |
void |
setTex1YMovement(float dis)
Set texture movement on texture unit 0 in y direction |
void |
setTexUnit0(java.lang.String path,
boolean mipmap)
Specifies the base texture that shall be used for this mesh at texture unit 0. |
void |
setTexUnit0(java.lang.String path,
boolean mipmap,
boolean rotate,
boolean flip)
Specifies the base texture that shall be used for this mesh at texture unit 0. |
void |
setTexUnit1(java.lang.String path,
boolean mipmap)
Specifies the texture that shall be used for this mesh at texture unit 1. |
void |
setTexUnit1(java.lang.String path,
boolean mipmap,
boolean rotate,
boolean flip)
Specifies the texture that shall be used for this mesh at texture unit 1. |
void |
setTransparency(float alpha)
Sets the transparency of the mesh by setting the meshes' ambient and diffuse material alpha to the specified value |
void |
showWireFrame(boolean wireFrameSwitch)
Determines whether the mesh shall be rendered as a wireframe model. |
abstract void |
specializedDraw(javax.media.opengl.GL gl)
This method contains only the drawing operation fitting to the special kind of mesh. |
void |
translateX(float amount)
Translates the x coordinate by the specified amount. |
void |
translateY(float amount)
Translates the y coordinate by the specified amount. |
void |
translateZ(float amount)
Translates the z coordinate by the specified amount. |
void |
update(long elapsedTime)
Updates the mesh. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractMesh(boolean smooth)
smooth
- shade mesh smoothly? --> true=yes, false=nopublic AbstractMesh(boolean smooth, BoundingVolume type)
smooth
- shade mesh smoothly? --> true=yes, false=notype
- value from the BoundingVolume enumerationMethod Detail |
---|
public boolean isDrawingEnabled()
public void setDrawingEnabled(boolean draw)
draw
- draw mesh? --> true=yes, false=nopublic boolean isOccluded()
public void setEnabledOcclusionCulling(boolean enable)
enable
- enable occlusion culling --> true=yes, false=nopublic boolean isEnabledOcclusionCulling()
public void setName(java.lang.String name)
name
- name for the mesh (recommended to be unique)public java.lang.String getName()
public abstract java.util.List<Triangle> getFaces()
public abstract java.util.List<Triangle> getFacesTransformed()
@Deprecated public void addShader(ShaderIface shader)
shader
- shader to be applied on the meshpublic void setShowBoundingVolume(boolean show)
show
- show bounding volume? --> yes = true, no = falsepublic void setEnvironmentMap(EnvironmentMappingIface envirMap)
envirMap
- environment map to apply to the meshpublic void setMaterial(Material material)
material
- material for the meshpublic Material getMaterial()
public void setTransparency(float alpha)
alpha
- alpha value (1f = opaque. < 1f = transparent)public void setPosition(Point3D position)
position
- a Point3D object specifying a 3D positionpublic void setPosition(float x, float y, float z)
x
- x-coordinatey
- y-coordinatez
- z-coordinatepublic void setPosX(float x)
x
- x-coordinatepublic void translateX(float amount)
amount
- amount to translate the x-coordinate bypublic void setPosY(float y)
y
- y-coordinatepublic void translateY(float amount)
amount
- amount to translate the y-coordinate bypublic void setPosZ(float z)
z
- z-coordinatepublic void translateZ(float amount)
amount
- amount to translate the z-coordinate bypublic float getHeightOffset()
public Point3D getPosition()
public float getPosX()
public float getPosY()
public float getPosZ()
public void setBlendFunction(BlendSourceFactor srcFact, BlendDestFactor destFact)
srcFact
- source factor for blending functiondestFact
- destination factor for blending functionspublic void setBlendSourceFactor(BlendSourceFactor srcFact)
srcFact
- source factor for blending functionpublic void setBlendDestFactor(BlendDestFactor destFact)
destFact
- destination factor for blending functionpublic void setTexUnit0(java.lang.String path, boolean mipmap)
path
- Path to the texture that shall be used for this meshmipmap
- mipmap the texture? --> true=yes, false=nopublic void setTexUnit0(java.lang.String path, boolean mipmap, boolean rotate, boolean flip)
path
- Path to the texture that shall be used for this meshmipmap
- mipmap the texture? --> true=yes, false=norotate
- rotate texture? --> true=yes, false=noflip
- flip texture? --> true=yes, false=nopublic com.sun.opengl.util.texture.Texture getTexUnit0()
public java.lang.String getTex0Path()
public boolean isTex0MipMapped()
public boolean isTex0Rotated()
public boolean isTex0Flipped()
public void setTex0TexEnvirMode(TexEnvirMode mode, float[] color)
Decal
and Modulate
mode
- texture environment mode for texture unit 0color
- new texture environment colorpublic void setTex0XMovement(float dis)
dis
- movement in x direction (values like 0.1f are good starting
points)public float getText0XMovement()
public void setTex0YMovement(float dis)
dis
- movement in z direction (values like 0.1f are good starting
points)public float getText0YMovement()
public void setTex0Movement(float moveX, float moveY)
moveX
- movement in x directionmoveY
- movemnt in y directionpublic void setTexUnit1(java.lang.String path, boolean mipmap)
path
- Path to the texture that shall be used for this meshmipmap
- mipmap the texture? --> true=yes, false=nopublic void setTexUnit1(java.lang.String path, boolean mipmap, boolean rotate, boolean flip)
path
- Path to the texture that shall be used for this meshmipmap
- mipmap the texture? --> true=yes, false=norotate
- rotate texture? --> true=yes, false=noflip
- flip texture? --> true=yes, false=nopublic com.sun.opengl.util.texture.Texture getTexUnit1()
public java.lang.String getTex1Path()
public boolean isTex1MipMapped()
public boolean isTex1Rotated()
public boolean isTex1Flipped()
public void setTex1TexEnvirMode(TexEnvirMode mode, float[] color)
Decal
and Modulate
mode
- texture environment mode for texture unit 1color
- new texture environment colorpublic void setTex1XMovement(float dis)
dis
- movement in x direction (values like 0.1f are good starting
points)public float getText1XMovement()
public void setTex1YMovement(float dis)
dis
- movement in z direction (values like 0.1f are good starting
points)public float getText1YMovement()
public void setTex1Movement(float moveX, float moveY)
moveX
- movement in x directionmoveY
- movemnt in y directionpublic void setShadowEnabled(boolean enable)
enable
- draw shadow? --> true=yes, false=nopublic boolean isShadowEnabled()
public BoundingVolumeIface getBoundingVolume()
null
public void setRotation(Point3D rot)
rot
- rotation vectorpublic void setRotation(float degX, float degY, float degZ)
degX
- degrees of rotation of x-axisdegY
- degrees of rotation of y-axisdegZ
- degrees of rotation of z-axispublic void setRotX(float degrees)
degrees
- Specifies the amount of degrees the mesh shall be rotatedpublic void setRotY(float degrees)
degrees
- Specifies the amount of degrees the mesh shall be rotatedpublic void setRotZ(float degrees)
degrees
- Specifies the amount of degrees the mesh shall be rotatedpublic Point3D getRotation()
public float getRotX()
public float getRotY()
public float getRotZ()
public void scale(float x, float y, float z)
x
- scale factor along the x-axisy
- scale factor along the y-axisz
- scale factor along the z-axispublic void setScaleX(float x)
x
- scale factor along the x-axispublic void setScaleY(float y)
y
- scale factor along the y-axispublic void setScaleZ(float z)
z
- scale factor along the z-axispublic float getScaleX()
public float getScaleY()
public float getScaleZ()
public void setAttachedGround(AbstractGroundMesh ground)
ground
- ground mesh to attach this mesh topublic void moveForwardLocal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time between two framespublic void moveForwardGlobal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time bewteen two framespublic void moveBackwardsLocal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time between two framespublic void moveBackwardsGlobal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time bewteen two framespublic void moveLeftLocal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time between two framespublic void moveLeftGlobal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time bewteen two framespublic void moveRightLocal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time between two framespublic void moveRightGlobal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time bewteen two framespublic void moveUpGlobal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time bewteen two framespublic void moveDownGlobal(float delta, long elapsedTime)
delta
- change of positionelapsedTime
- time bewteen two framespublic void moveTo(float x, float z, float speedMove, float speedRot, long elapsedTime)
x
- x-coordinatez
- z-coordinatespeedMove
- speed of movementspeedRot
- speed of rotationelapsedTime
- time between two framespublic void rotateRight(float delta, long elapsedTime)
delta
- change of rotationelapsedTime
- time bewteen two framespublic void rotateLeft(float delta, long elapsedTime)
delta
- change of rotationelapsedTime
- time bewteen two framespublic void rotateUp(float delta, long elapsedTime)
delta
- change of rotationelapsedTime
- time bewteen two framespublic void rotateDown(float delta, long elapsedTime)
delta
- change of rotationelapsedTime
- time bewteen two framespublic void showWireFrame(boolean wireFrameSwitch)
wireFrameSwitch
- true = wireframe on, false = wireframe offpublic void performTransformations(javax.media.opengl.GL gl)
gl
- public boolean isSmoothShaded()
public void setPickable(boolean pick)
pick
- set pickable? --> true=yes, false=nopublic boolean isPickable()
public boolean isCollidable()
public void setCollidable(boolean collidable)
collidable
- collidable flagpublic boolean isMouseOverMesh(int screenX, int screenY)
getPointOfIntersection()
method
from the CollisionFinder
class.
screenX
- screen x-coordinatescreenY
- screen y-coordinate
public Point3D getMouseOverMesh(int screenX, int screenY)
getPointOfIntersection()
method
from the CollisionFinder
class.
screenX
- screen x-coordinatescreenY
- screen y-coordinate
public void update(long elapsedTime)
elapsedTime
- time between two framespublic abstract void draw(javax.media.opengl.GL gl)
gl
- public abstract void specializedDraw(javax.media.opengl.GL gl)
gl
- @Deprecated public void drawShaders(javax.media.opengl.GL gl)
gl
- public abstract void destroy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |