8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
13 #include "IPhysicsMovableItem.h"
14 #include "IPhysicsBody.h"
16 #include "MovableItem.h"
57 m_fltSegmentWidth = 1;
58 m_fltSegmentLength = 1;
60 m_iTextureLengthSegments = 10;
61 m_iTextureWidthSegments = 10;
75 float Terrain::SegmentWidth() {
return m_fltSegmentWidth;}
77 void Terrain::SegmentWidth(
float fltVal,
bool bUseScaling)
83 m_fltSegmentWidth = fltVal;
88 float Terrain::SegmentLength() {
return m_fltSegmentLength;}
90 void Terrain::SegmentLength(
float fltVal,
bool bUseScaling)
96 m_fltSegmentLength = fltVal;
101 float Terrain::MaxHeight() {
return m_fltMaxHeight;}
103 void Terrain::MaxHeight(
float fltVal,
bool bUseScaling)
109 m_fltMaxHeight = fltVal;
114 int Terrain::TextureLengthSegments()
115 {
return m_iTextureLengthSegments;}
117 void Terrain::TextureLengthSegments(
int iVal)
119 Std_IsAboveMin((
int) 0, iVal,
true,
"Terrain.TextureLengthSegments");
120 m_iTextureLengthSegments = iVal;
126 int Terrain::TextureWidthSegments()
127 {
return m_iTextureWidthSegments;}
129 void Terrain::TextureWidthSegments(
int iVal)
131 Std_IsAboveMin((
int) 0, iVal,
true,
"Terrain.TextureWidthSegments");
132 m_iTextureWidthSegments = iVal;
144 bool Terrain::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
148 if(Mesh::SetData(strType, strValue,
false))
151 if(strType ==
"SEGMENTWIDTH")
153 SegmentWidth((
float) atof(strValue.c_str()));
157 if(strType ==
"SEGMENTLENGTH")
159 SegmentLength((
float) atof(strValue.c_str()));
163 if(strType ==
"MAXHEIGHT")
165 MaxHeight((
float) atof(strValue.c_str()));
169 if(strType ==
"TEXTURELENGTHSEGMENTS")
171 TextureLengthSegments(atoi(strValue.c_str()));
175 if(strType ==
"TEXTUREWIDTHSEGMENTS")
177 TextureWidthSegments(atoi(strValue.c_str()));
183 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
188 void Terrain::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
190 Mesh::QueryProperties(aryProperties);
192 aryProperties.Add(
new TypeProperty(
"SegmentWidth", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
193 aryProperties.Add(
new TypeProperty(
"SegmentLength", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
194 aryProperties.Add(
new TypeProperty(
"MaxHeight", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
195 aryProperties.Add(
new TypeProperty(
"TextureLengthSegments", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
196 aryProperties.Add(
new TypeProperty(
"TextureWidthSegments", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
199 void Terrain::Load(
CStdXml &oXml)
205 SegmentWidth(oXml.
GetChildFloat(
"SegmentWidth", m_fltSegmentWidth));
206 SegmentLength(oXml.
GetChildFloat(
"SegmentLength", m_fltSegmentLength));
208 TextureLengthSegments(oXml.
GetChildInt(
"TextureLengthSegments", m_iTextureLengthSegments));
209 TextureWidthSegments(oXml.
GetChildInt(
"TextureWidthSegments", m_iTextureWidthSegments));
Base class file for all Animat simulation objects.
Declares the simulation recorder class.
Root namespace for the base simulation library for AnimatLab.
Declares the body part class.
std::string m_strCollisionMeshType
Type of the collision mesh. Can be Convex or Triangular.
Simulator * m_lpSim
The pointer to a Simulation.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
Class that stores information about types for QueryProperty information.
Declares the key frame class.
Declares the joint class.
Declares the organism class.
virtual int GetChildInt(std::string strElementName)
Gets an integer value from the element with the specified name.
virtual std::string Texture()
Gets the texture filename.
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
virtual void Resize()
Called when this object has been resized.
Declares the activated item class.
virtual ~Terrain()
Destructor.
Declares a light manager object.
float m_fltDensity
Uniform density for the rigid body.
Declares the bounding box class.
A standard xml manipulation class.
virtual bool AllowRotateDragX()
Gets whether this body part can be rotated along the x-axis by the user with the drag handlers...
virtual bool AllowRotateDragZ()
Gets whether this body part can be rotated along the z-axis by the user with the drag handlers...
virtual bool AllowRotateDragY()
Gets whether this body part can be rotated along the y-axis by the user with the drag handlers...
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
Terrain()
Default constructor.
Declares the data chart manager class.
Declares the rigid body class.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
Declares the terrain class.
Declares the structure class.
Declares the odor type class.
virtual float InverseDistanceUnits()
Gets the inverse distance units.
Declares the simulator class.
Declares the activated item manager class.
Declares the external stimuli manager class.
Declares the receptive field class.
std::string m_strTexture
An optional texture to apply to the rigid body.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.