|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::IShape Class ReferenceThe basic interface for shapes.
More...
#include <shape.h>
Inheritance diagram for NL3D::IShape:
List of all members.
Detailed Description
The basic interface for shapes.
A shape is a kind of instanciable mesh. For simplicity, render() and clip() virtual method are provided, so majority of shape could be implemented by just define those methods, and let createInstance() as default. But other complex shapes may be defined, by implement a compatible model which will comunicate with them.
Serialisation of a shape MUST be done with ISTREAM::serialPolyPtr.
DERIVER RULES:
- simple: just implement clip() and render(). The shape will be movable via CTransform.
- complex: if special interaction is needed between the instance and the shape:
- implement a special Model, derived from CTransformShape, adding your instance behavior.
- implement YourShape::createInstance(), so it create this good model.
- implement your own communication system between the model and the shape.
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 70 of file shape.h.
Constructor & Destructor Documentation
virtual NL3D::IShape::~IShape |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
virtual bool NL3D::IShape::clip |
( |
const std::vector< CPlane > & |
pyramid, |
|
|
const CMatrix & |
worldMatrix |
|
) |
[inline, virtual] |
|
|
clip this shape with a pyramid.
the pyramid is given in world space.The world matrix of the object is given. -
Parameters:
-
pyramid |
the clipping polytope, planes are normalized. |
worldMatrix |
the world matrix of the instance. |
-
Returns:
-
true if the object is visible, false otherwise. The default behavior is to return true (never clipped).
Reimplemented in NL3D::CFlareShape.
Definition at line 92 of file shape.h. |
|
create an instance of this shape.
The instance may be a CTransformShape, or a specialized version of it. The default behavior is to createModel() a CTransformShape, and just assign to it the Shape. -
Parameters:
-
scene |
the scene used to createModel(). |
-
Returns:
-
the specialized instance for this shape.
Reimplemented in NL3D::CFlareShape.
Definition at line 50 of file shape.cpp. |
virtual void NL3D::IShape::flushTextures |
( |
IDriver & |
driver |
) |
[pure virtual] |
|
|
return the bounding box of the shape.
Default is to return Null bbox.
Reimplemented in NL3D::CFlareShape.
Definition at line 76 of file shape.cpp. |
float NL3D::IShape::getDistMax |
( |
|
) |
const [inline] |
|
|
return the DistMax where the shape is no more displayed.
Default is to return -1, meaning DistMax = infinite.
Definition at line 111 of file shape.h.
References _DistMax. |
virtual float NL3D::IShape::getNumTriangles |
( |
float |
distance |
) |
[pure virtual] |
|
|
get an approximation of the number of triangles this instance will render for a fixed distance.
return 0 if do not support degradation.
Implemented in NL3D::CFlareShape. |
|
render() this shape in a driver, with the specified TransformShape information.
CTransfromShape call this method in the render traversal. if opaquePass render the opaque materials else render the transparent materials.
Implemented in NL3D::CFlareShape. |
void NL3D::IShape::setDistMax |
( |
float |
distMax |
) |
|
|
|
setup the DistMax where the shape is no more displayed.
Take effect only for the next created instances. setting <0 means -1 and so means DistMax = infinite.
Definition at line 66 of file shape.cpp.
References _DistMax.
Referenced by NL3D::CFlareShape::CFlareShape. |
virtual IMeshGeom* NL3D::IShape::supportMeshBlockRendering |
( |
CTransformShape * |
trans, |
|
|
float & |
polygonCount |
|
) |
const [inline, virtual] |
|
|
return !NULL if this shape can support MeshBlock rendering for a special instance.
NB: Mesh Block render cannot occurs if the Mesh is Skinned/MeshMorphed. NB: Mesh Block render can occurs only in Opaque pass NB: Mesh block render can occurs only for CMeshBase meshes. -
Parameters:
-
trans |
the instance to take into account (meshMultiLod may return NULL in blend transition). |
polygonCount |
the number of polygons to render for the meshGeom returned |
-
Returns:
-
the meshgeom to render per block if OK, else NULL (default)
Reimplemented in NL3D::CMesh.
Definition at line 152 of file shape.h. |
virtual bool NL3D::IShape::useLightingLocalAttenuation |
( |
|
) |
const [inline, virtual] |
|
|
tells if the shape wants LocalAttenuation for RealTime lighting.
Default is false
Reimplemented in NL3D::CMeshBase.
Definition at line 136 of file shape.h. |
Member Data Documentation
float NL3D::IShape::_DistMax [protected]
|
|
The documentation for this class was generated from the following files:
|
|