28 #ifndef __InstancedGeometry_H__
29 #define __InstancedGeometry_H__
206 void copyIndexes(
const T* src, T* dst,
size_t count,
size_t indexOffset)
208 if (indexOffset == 0)
210 memcpy(dst, src,
sizeof(T) * count);
216 *dst++ =
static_cast<T
>(*src++ + indexOffset);
233 Real getBoundingRadius(
void)
const;
241 void getWorldTransforms(
Matrix4* xform)
const;
242 virtual unsigned short getNumWorldTransforms(
void)
const ;
243 Real getSquaredViewDepth(
const Camera* cam)
const;
245 bool getCastsShadows(
void)
const;
246 String getFormatString(
void)
const;
254 void dump(std::ofstream& of)
const;
297 void setPosition(
Vector3 position);
298 const Vector3& getPosition(
void)
const;
299 void yaw(
const Radian& angle);
300 void pitch(
const Radian& angle);
301 void roll(
const Radian& angle);
303 void setScale(
const Vector3& scale);
304 const Vector3& getScale()
const;
312 void translate(
const Vector3& d);
313 Matrix3 getLocalAxes(
void)
const;
314 void updateAnimation(
void);
366 void dump(std::ofstream& of)
const;
375 void setMaterial(
const String & name);
420 void dump(std::ofstream& of)
const;
493 const String& getMovableType(
void)
const;
494 void _notifyCurrentCamera(
Camera* cam);
497 Real getBoundingRadius(
void)
const;
499 bool isVisible(
void)
const;
502 bool debugRenderables =
false);
513 void updateBoundingBox();
516 void dump(std::ofstream& of)
const;
518 void updateContainers(
LODBucket* bucket );
520 void attachToScene();
521 void addInstancedObject(
unsigned short index,
InstancedObject*
object);
598 virtual void getBatchInstanceIndexes(
const Vector3& point,
631 template <
typename T>
635 for (
size_t i = 0; i < numIndexes; ++i)
638 remap.insert(IndexRemap::value_type(*pBuffer++, remap.size()));
644 template <
typename T>
648 for (
size_t i = 0; i < numIndexes; ++i)
651 IndexRemap::const_iterator ix = remap.find(*src++);
652 assert(ix != remap.end());
653 *dst++ =
static_cast<T
>(ix->second);
707 virtual void addSceneNode(
const SceneNode* node);
719 virtual void build(
void);
728 void addBatchInstance(
void);
734 virtual void destroy(
void);
739 virtual void reset(
void);
751 mUpperDistance = dist;
752 mSquaredUpperDistance = mUpperDistance * mUpperDistance;
760 {
return mSquaredUpperDistance; }
763 virtual void setVisible(
bool visible);
785 virtual void setCastShadows(
bool castShadows);
800 mBatchInstanceDimensions = size;
801 mHalfBatchInstanceDimensions = size * 0.5;
831 virtual void setRenderQueueGroup(
uint8 queueID);
834 virtual uint8 getRenderQueueGroup(
void)
const;
843 bool debugRenderables =
false);
848 virtual void dump(
const String& filename)
const;
876 virtual void setProvideWorldInverses(
bool flag);