CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

iPolygon3DStatic Struct Reference

This is the interface to the static part of a 3D polygon. More...

#include <polygon.h>

Inheritance diagram for iPolygon3DStatic:

iBase List of all members.

Public Methods

virtual csPolygon3DStatic * GetPrivateObject ()=0
 @ UGLY! Used by engine to retrieve internal object structure. More...

virtual const char * GetName () const=0
 Get the name of this polygon. More...

virtual void SetName (const char *name)=0
 Set the name of this polygon. More...

virtual iThingFactoryStateGetParent ()=0
 Get the thing (container) that this polygon belongs to. More...

virtual iMaterialHandleGetMaterialHandle ()=0
 Get the material handle for the texture manager. More...

virtual void SetMaterial (iMaterialWrapper *mat)=0
 Set the material for this polygon. More...

virtual iMaterialWrapperGetMaterial ()=0
 Get the material for this polygon. More...

virtual int GetVertexCount ()=0
 Query number of vertices in this polygon. More...

virtual int * GetVertexIndices ()=0
 Get the vertex indices array. More...

virtual const csVector3GetVertex (int idx) const=0
 Get the given polygon vertex coordinates in object space. More...

virtual int CreateVertex (int idx)=0
 Create a polygon vertex given his index in parent polygon set. More...

virtual int CreateVertex (const csVector3 &iVertex)=0
 Create a polygon vertex and add it to parent object. More...

virtual int GetAlpha ()=0
 Get the alpha transparency value for this polygon. More...

virtual void SetAlpha (int iAlpha)=0
 Set the alpha transparency value for this polygon. More...

virtual void CreatePlane (const csVector3 &iOrigin, const csMatrix3 &iMatrix)=0
 Create a private polygon texture mapping plane. More...

virtual csFlagsGetFlags ()=0
 Set polygon flags (see CS_POLY_... values above). More...

virtual iPortalCreateNullPortal ()=0
 Create a null pointer pointing to no sector. More...

virtual iPortalCreatePortal (iSector *iTarget)=0
 Create a portal object pointing to given sector. More...

virtual iPortalGetPortal ()=0
 Return the pointer to the portal if there is one. More...

virtual void SetTextureSpace (const csVector3 &p1, const csVector2 &uv1, const csVector3 &p2, const csVector2 &uv2, const csVector3 &p3, const csVector2 &uv3)=0
 Set the texture space transformation given three vertices and their uv coordinates. More...

virtual void SetTextureSpace (const csVector3 &v_orig, const csVector3 &v1, float l1)=0
 Calculate the matrix using two vertices (which are preferably on the plane of the polygon and are possibly (but not necessarily) two vertices of the polygon). More...

virtual void SetTextureSpace (const csVector3 &v_orig, const csVector3 &v1, float len1, const csVector3 &v2, float len2)=0
 Calculate the matrix using 'v1' and 'len1' for the u-axis and 'v2' and 'len2' for the v-axis. More...

virtual void SetTextureSpace (const csMatrix3 &, const csVector3 &)=0
 The most general function. More...

virtual void GetTextureSpace (csMatrix3 &, csVector3 &)=0
 Get the texture space information. More...

virtual void EnableTextureMapping (bool enable)=0
 Disable or enable texture mapping. More...

virtual bool IsTextureMappingEnabled () const=0
 Check if texture mapping is enabled. More...

virtual void CopyTextureType (iPolygon3DStatic *other_polygon)=0
 Copy texture type settings from another polygon. More...

virtual const csPlane3GetObjectPlane ()=0
 Get object space plane. More...

virtual bool IsTransparent ()=0
 Return true if this polygon or the texture it uses is transparent. More...

virtual void SetMixMode (uint m)=0
 Sets the mode that is used for drawing. More...

virtual uint GetMixMode ()=0
 Gets the mode that is used for drawing. More...

virtual bool IntersectSegment (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr=0)=0
 Intersect object-space segment with this polygon. More...

virtual bool IntersectRay (const csVector3 &start, const csVector3 &end)=0
 Intersect object-space ray with this polygon. More...

virtual bool IntersectRayNoBackFace (const csVector3 &start, const csVector3 &end)=0
 Intersect object-space ray with this polygon. More...

virtual bool IntersectRayPlane (const csVector3 &start, const csVector3 &end, csVector3 &isect)=0
 Intersect object space ray with the plane of this polygon and returns the intersection point. More...

virtual bool PointOnPolygon (const csVector3 &v)=0
 This is a given point is on (or very nearly on) this polygon. More...


Detailed Description

This is the interface to the static part of a 3D polygon.

Definition at line 73 of file polygon.h.


Member Function Documentation

virtual void iPolygon3DStatic::CopyTextureType iPolygon3DStatic *    other_polygon [pure virtual]
 

Copy texture type settings from another polygon.

(this will not copy the actual material that is used, just the information on how to apply that material to the polygon).

virtual iPortal* iPolygon3DStatic::CreateNullPortal   [pure virtual]
 

Create a null pointer pointing to no sector.

It is preferably to set a missing sector callback on the returned portal.

virtual void iPolygon3DStatic::CreatePlane const csVector3   iOrigin,
const csMatrix3   iMatrix
[pure virtual]
 

Create a private polygon texture mapping plane.

virtual iPortal* iPolygon3DStatic::CreatePortal iSector   iTarget [pure virtual]
 

Create a portal object pointing to given sector.

virtual int iPolygon3DStatic::CreateVertex const csVector3   iVertex [pure virtual]
 

Create a polygon vertex and add it to parent object.

virtual int iPolygon3DStatic::CreateVertex int    idx [pure virtual]
 

Create a polygon vertex given his index in parent polygon set.

virtual void iPolygon3DStatic::EnableTextureMapping bool    enable [pure virtual]
 

Disable or enable texture mapping.

Doesn't do anything if nothing has changed.

virtual int iPolygon3DStatic::GetAlpha   [pure virtual]
 

Get the alpha transparency value for this polygon.

virtual csFlags& iPolygon3DStatic::GetFlags   [pure virtual]
 

Set polygon flags (see CS_POLY_... values above).

virtual iMaterialWrapper* iPolygon3DStatic::GetMaterial   [pure virtual]
 

Get the material for this polygon.

virtual iMaterialHandle* iPolygon3DStatic::GetMaterialHandle   [pure virtual]
 

Get the material handle for the texture manager.

virtual uint iPolygon3DStatic::GetMixMode   [pure virtual]
 

Gets the mode that is used for drawing.

virtual const char* iPolygon3DStatic::GetName   const [pure virtual]
 

Get the name of this polygon.

virtual const csPlane3& iPolygon3DStatic::GetObjectPlane   [pure virtual]
 

Get object space plane.

virtual iThingFactoryState* iPolygon3DStatic::GetParent   [pure virtual]
 

Get the thing (container) that this polygon belongs to.

The reference counter on iThingFactoryState is NOT incremented.

virtual iPortal* iPolygon3DStatic::GetPortal   [pure virtual]
 

Return the pointer to the portal if there is one.

virtual csPolygon3DStatic* iPolygon3DStatic::GetPrivateObject   [pure virtual]
 

@ UGLY! Used by engine to retrieve internal object structure.

@

virtual void iPolygon3DStatic::GetTextureSpace csMatrix3  ,
csVector3  
[pure virtual]
 

Get the texture space information.

virtual const csVector3& iPolygon3DStatic::GetVertex int    idx const [pure virtual]
 

Get the given polygon vertex coordinates in object space.

virtual int iPolygon3DStatic::GetVertexCount   [pure virtual]
 

Query number of vertices in this polygon.

virtual int* iPolygon3DStatic::GetVertexIndices   [pure virtual]
 

Get the vertex indices array.

virtual bool iPolygon3DStatic::IntersectRay const csVector3   start,
const csVector3   end
[pure virtual]
 

Intersect object-space ray with this polygon.

This function is similar to IntersectSegment except that it doesn't keep the lenght of the ray in account. It just tests if the ray intersects with the interior of the polygon. Note that this function also does back-face culling.

virtual bool iPolygon3DStatic::IntersectRayNoBackFace const csVector3   start,
const csVector3   end
[pure virtual]
 

Intersect object-space ray with this polygon.

This function is similar to IntersectSegment except that it doesn't keep the lenght of the ray in account. It just tests if the ray intersects with the interior of the polygon. Note that this function doesn't do back-face culling.

virtual bool iPolygon3DStatic::IntersectRayPlane const csVector3   start,
const csVector3   end,
csVector3   isect
[pure virtual]
 

Intersect object space ray with the plane of this polygon and returns the intersection point.

This function does not test if the intersection is inside the polygon. It just returns the intersection with the plane (in or out). This function returns false if the ray is parallel with the plane (i.e. there is no intersection).

virtual bool iPolygon3DStatic::IntersectSegment const csVector3   start,
const csVector3   end,
csVector3   isect,
float *    pr = 0
[pure virtual]
 

Intersect object-space segment with this polygon.

Return true if it intersects and the intersection point in object coordinates.

virtual bool iPolygon3DStatic::IsTextureMappingEnabled   const [pure virtual]
 

Check if texture mapping is enabled.

virtual bool iPolygon3DStatic::IsTransparent   [pure virtual]
 

Return true if this polygon or the texture it uses is transparent.

virtual bool iPolygon3DStatic::PointOnPolygon const csVector3   v [pure virtual]
 

This is a given point is on (or very nearly on) this polygon.

Test happens in object space.

virtual void iPolygon3DStatic::SetAlpha int    iAlpha [pure virtual]
 

Set the alpha transparency value for this polygon.

Not all renderers support all possible values. 0, 25, 50, 75, and 100 will always work but other values may give only the closest possible to one of the above.

virtual void iPolygon3DStatic::SetMaterial iMaterialWrapper   mat [pure virtual]
 

Set the material for this polygon.

WARNING: if you initially created the polygon with a material without texture then texture mapping will be disabled for this polygon. You need to call EnableTextureMapping(true) again to really enable texture mapping.

virtual void iPolygon3DStatic::SetMixMode uint    m [pure virtual]
 

Sets the mode that is used for drawing.

virtual void iPolygon3DStatic::SetName const char *    name [pure virtual]
 

Set the name of this polygon.

virtual void iPolygon3DStatic::SetTextureSpace const csMatrix3  ,
const csVector3  
[pure virtual]
 

The most general function.

With these you provide the matrix directly.

virtual void iPolygon3DStatic::SetTextureSpace const csVector3   v_orig,
const csVector3   v1,
float    len1,
const csVector3   v2,
float    len2
[pure virtual]
 

Calculate the matrix using 'v1' and 'len1' for the u-axis and 'v2' and 'len2' for the v-axis.

virtual void iPolygon3DStatic::SetTextureSpace const csVector3   v_orig,
const csVector3   v1,
float    l1
[pure virtual]
 

Calculate the matrix using two vertices (which are preferably on the plane of the polygon and are possibly (but not necessarily) two vertices of the polygon).

The first vertex is seen as the origin and the second as the u-axis of the texture space coordinate system. The v-axis is calculated on the plane of the polygon and orthogonal to the given u-axis. The length of the u-axis and the v-axis is given as the 'len1' parameter.

For example, if 'len1' is equal to 2 this means that texture will be tiled exactly two times between vertex 'v_orig' and 'v1'.

I hope this explanation is clear since I can't seem to make it any clearer :-)

virtual void iPolygon3DStatic::SetTextureSpace const csVector3   p1,
const csVector2   uv1,
const csVector3   p2,
const csVector2   uv2,
const csVector3   p3,
const csVector2   uv3
[pure virtual]
 

Set the texture space transformation given three vertices and their uv coordinates.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14