ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

A floor face is a 3D triangle used to build the floor. More...

#include <floorface.h>

Inheritance diagram for Stark::Resources::FloorFace:
Collaboration diagram for Stark::Resources::FloorFace:

List of all members.

Public Member Functions

 FloorFace (Object *parent, byte subType, uint16 index, const Common::String &name)
virtual ~FloorFace ()
virtual void onAllLoaded () override
 Called when the resource sub-tree is entirely loaded.
bool isPointInside (const Math::Vector3d &point) const
 Return true if the point is inside the face when both are projected on a Z=0 plane.
void computePointHeight (Math::Vector3d &point) const
 Fill the z coordinate of the point so that it is on the plane.
bool intersectRay (const Math::Ray &ray, Math::Vector3d &intersection) const
 Check if a ray is intersecting this face.
float distanceToRay (const Math::Ray &ray) const
 Compute the distance between the face center and the ray.
float getDistanceFromCamera () const
 Obtain the distance to the camera.
int16 getVertexIndex (int32 index) const
 Get one of the three vertex indices from the face.
void addEdge (FloorEdge *edge)
 Add an edge to the triangle edge list.
Common::Array< FloorEdge * > getEdges () const
 Get the triangle's edge list.
FloorEdgefindNearestEdge (const Math::Vector3d &point) const
 Find the edge closest to a point.
Math::Vector3d getCenter () const
 Get the point at the center of the face's triangle.
bool hasVertices () const
 Checks if the face is non degenerate.
void enable (bool enable)
 Allow or disallow characters to walk on this face.
bool isEnabled () const

Static Public Attributes

static const Type::ResourceType TYPE = Type::kFloorFace

Protected Member Functions

void readData (Formats::XRCReadStream *stream) override
 Deserialize the resource static data and initial state.
void printData () override

Protected Attributes

int16 _indices [3]
Math::Vector3d _vertices [3]
Common::Array< FloorEdge * > _edges
float _distanceFromCamera
float _unk2

Detailed Description

A floor face is a 3D triangle used to build the floor.

Definition at line 47 of file floorface.h.


Constructor & Destructor Documentation

Stark::Resources::FloorFace::FloorFace ( Object parent,
byte  subType,
uint16  index,
const Common::String name 
)

Definition at line 32 of file floorface.cpp.

Stark::Resources::FloorFace::~FloorFace (  )  [virtual]

Definition at line 43 of file floorface.cpp.


Member Function Documentation

void Stark::Resources::FloorFace::addEdge ( FloorEdge edge  ) 

Add an edge to the triangle edge list.

Definition at line 138 of file floorface.cpp.

void Stark::Resources::FloorFace::computePointHeight ( Math::Vector3d point  )  const

Fill the z coordinate of the point so that it is on the plane.

Definition at line 68 of file floorface.cpp.

float Stark::Resources::FloorFace::distanceToRay ( const Math::Ray ray  )  const

Compute the distance between the face center and the ray.

Definition at line 124 of file floorface.cpp.

void Stark::Resources::FloorFace::enable ( bool  enable  ) 

Allow or disallow characters to walk on this face.

Definition at line 175 of file floorface.cpp.

FloorEdge * Stark::Resources::FloorFace::findNearestEdge ( const Math::Vector3d point  )  const

Find the edge closest to a point.

Distance are compared using the middle point of each edge of the face

Definition at line 146 of file floorface.cpp.

Math::Vector3d Stark::Resources::FloorFace::getCenter (  )  const

Get the point at the center of the face's triangle.

Definition at line 167 of file floorface.cpp.

float Stark::Resources::FloorFace::getDistanceFromCamera (  )  const

Obtain the distance to the camera.

Definition at line 129 of file floorface.cpp.

Common::Array< FloorEdge * > Stark::Resources::FloorFace::getEdges (  )  const

Get the triangle's edge list.

Definition at line 142 of file floorface.cpp.

int16 Stark::Resources::FloorFace::getVertexIndex ( int32  index  )  const

Get one of the three vertex indices from the face.

Definition at line 133 of file floorface.cpp.

bool Stark::Resources::FloorFace::hasVertices (  )  const

Checks if the face is non degenerate.

Definition at line 171 of file floorface.cpp.

bool Stark::Resources::FloorFace::intersectRay ( const Math::Ray ray,
Math::Vector3d intersection 
) const

Check if a ray is intersecting this face.

Parameters:
origin The ray's origin
direction The ray's direction
intersection The intersection between the ray and the face. Only valid when the return value is true.
Returns:
true if the ray intersects the face, false otherwise.

Definition at line 92 of file floorface.cpp.

bool Stark::Resources::FloorFace::isEnabled (  )  const

Definition at line 181 of file floorface.cpp.

bool Stark::Resources::FloorFace::isPointInside ( const Math::Vector3d point  )  const

Return true if the point is inside the face when both are projected on a Z=0 plane.

Definition at line 46 of file floorface.cpp.

void Stark::Resources::FloorFace::onAllLoaded (  )  [override, virtual]

Called when the resource sub-tree is entirely loaded.

Allows to load data from other nodes.

Reimplemented from Stark::Resources::Object.

Definition at line 205 of file floorface.cpp.

void Stark::Resources::FloorFace::printData (  )  [override, protected, virtual]

Reimplemented from Stark::Resources::Object.

Definition at line 214 of file floorface.cpp.

void Stark::Resources::FloorFace::readData ( Formats::XRCReadStream stream  )  [override, protected, virtual]

Deserialize the resource static data and initial state.

Reimplemented from Stark::Resources::Object.

Definition at line 191 of file floorface.cpp.


Member Data Documentation

Definition at line 116 of file floorface.h.

Definition at line 114 of file floorface.h.

Definition at line 111 of file floorface.h.

Definition at line 117 of file floorface.h.

Definition at line 112 of file floorface.h.

const Type::ResourceType Stark::Resources::FloorFace::TYPE = Type::kFloorFace [static]

Definition at line 49 of file floorface.h.


The documentation for this class was generated from the following files:


Generated on Sat Mar 23 2019 05:09:10 for ResidualVM by doxygen 1.7.1
curved edge   curved edge