00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __DUSTY_ENTITY_H__
00032 #define __DUSTY_ENTITY_H__
00033
00034 #include <irrlicht.h>
00035 #include "dustyengine.h"
00036
00037 namespace DustyEngine
00038 {
00039 class NodeAffector;
00040 class EntityParentTask;
00041 const irr::u32 DEFAULT_UPDATE_INTERVAL = 20;
00042
00044 enum EntityActionType
00045 {
00047 VECTOR = 0,
00049 INTERPOLATED,
00051 BOUNDED,
00053 WAYPOINT
00054 };
00055
00057
00074 class DUSTYENGINE_API Entity : public irr::IUnknown, public NodeAffector
00075 {
00076 public:
00079 Entity(DustyDriver * d);
00080
00082 virtual ~Entity();
00083
00086
00088 void SetUpdateInterval(irr::u32 interval);
00089
00092 irr::u32 GetUpdateInterval();
00093
00095 void SetMoveType(EntityActionType type);
00096
00098 void SetRotateType(EntityActionType type);
00099
00101 void SetScaleType(EntityActionType type);
00102
00104 EntityActionType GetMoveType();
00105
00107 EntityActionType GetRotateType();
00108
00110 EntityActionType GetScaleType();
00111
00113 void Pause();
00114
00116 void Unpause();
00117
00119 void PauseMovement();
00120
00122 void PauseRotation();
00123
00125 void PauseScaling();
00126
00128 void UnpauseMovement();
00129
00131 void UnpauseRotation();
00132
00134 void UnpauseScaling();
00135
00137 void SetExecuteMultiple(bool multiple);
00138 bool GetExecuteMultiple();
00139
00142 void SetNode(irr::scene::ISceneNode * n);
00143
00145
00148 EntityParentTask * GetParentTask();
00149
00152 void SetRemoveNodeOnDestroy(bool remove);
00153
00155 bool GetRemoveNodeOnDestroy();
00156
00157
00158
00160
00163 void SetMoveVector(irr::core::vector3df vector);
00164
00166 irr::core::vector3df GetMoveVector();
00167
00169
00172 void SetScaleVector(irr::core::vector3df vector);
00173
00175 irr::core::vector3df GetScaleVector();
00176
00178
00181 void SetRotateVector(irr::core::vector3df vector);
00182
00184 irr::core::vector3df GetRotateVector();
00185
00186
00187
00189
00192 void SetMoveBoundaries(irr::core::vector3df min, irr::core::vector3df max);
00193
00195 void SetMoveMinBoundary(irr::core::vector3df min);
00196
00198 void SetMoveMaxBoundary(irr::core::vector3df max);
00199
00201 irr::core::vector3df GetMoveMinBoundary();
00202
00204 irr::core::vector3df GetMoveMaxBoundary();
00205
00207 irr::u32 GetMoveCollisionValue();
00208
00210
00213 void SetScaleBoundaries(irr::core::vector3df min, irr::core::vector3df max);
00214
00216 void SetScaleMinBoundary(irr::core::vector3df min);
00217
00219 void SetScaleMaxBoundary(irr::core::vector3df max);
00220
00222 irr::core::vector3df GetScaleMinBoundary();
00223
00225 irr::core::vector3df GetScaleMaxBoundary();
00226
00228 irr::u32 GetScaleCollisionValue();
00229
00231
00234 void SetRotateBoundaries(irr::core::vector3df min, irr::core::vector3df max);
00235
00237 void SetRotateMinBoundary(irr::core::vector3df min);
00238
00240 void SetRotateMaxBoundary(irr::core::vector3df max);
00241
00243 irr::core::vector3df GetRotateMinBoundary();
00244
00246 irr::core::vector3df GetRotateMaxBoundary();
00247
00249 irr::u32 GetRotateCollisionValue();
00250
00251
00252
00255 void SetMoveLooping(bool loop);
00256
00258 bool GetMoveLooping();
00259
00262 void SetMoveReverseLooping(bool loop);
00263
00265 bool GetMoveReverseLooping();
00266
00269 void SetMoveInterpolationTime(irr::u32 time);
00270
00272 irr::u32 GetMoveInterpolationTime();
00273
00276 void SetMoveInterpolationValue(irr::f32 value);
00277
00279 irr::f32 GetMoveInterpolationValue();
00280
00283 void SetMoveStartPoint(irr::core::vector3df start);
00284
00286 irr::core::vector3df GetMoveStartPoint();
00287
00290 void SetMoveEndPoint(irr::core::vector3df end);
00291
00293 irr::core::vector3df GetMoveEndPoint();
00294
00296 void ReverseMoveInterpolation();
00297
00299 bool IsMoveInterpolatedReversed();
00300
00303 void SetRotateLooping(bool loop);
00304
00306 bool GetRotateLooping();
00307
00310 void SetRotateReverseLooping(bool loop);
00311
00313 bool GetRotateReverseLooping();
00314
00317 void SetRotateInterpolationTime(irr::u32 time);
00318
00320 irr::u32 GetRotateInterpolationTime();
00321
00324 void SetRotateInterpolationValue(irr::f32 value);
00325
00327 irr::f32 GetRotateInterpolationValue();
00328
00331 void SetRotateStartPoint(irr::core::vector3df start);
00332
00334 irr::core::vector3df GetRotateStartPoint();
00335
00338 void SetRotateEndPoint(irr::core::vector3df end);
00339
00341 irr::core::vector3df GetRotateEndPoint();
00342
00344 void ReverseRotateInterpolation();
00345
00347 bool IsRotateInterpolatedReversed();
00348
00351 void SetScaleLooping(bool loop);
00352
00354 bool GetScaleLooping();
00355
00358 void SetScaleReverseLooping(bool loop);
00359
00361 bool GetScaleReverseLooping();
00362
00365 void SetScaleInterpolationTime(irr::u32 time);
00366
00368 irr::u32 GetScaleInterpolationTime();
00369
00372 void SetScaleInterpolationValue(irr::f32 value);
00373
00375 irr::f32 GetScaleInterpolationValue();
00376
00379 void SetScaleStartPoint(irr::core::vector3df start);
00380
00382 irr::core::vector3df GetScaleStartPoint();
00383
00386 void SetScaleEndPoint(irr::core::vector3df end);
00387
00389 irr::core::vector3df GetScaleEndPoint();
00390
00392 void ReverseScaleInterpolation();
00393
00395 bool IsScaleInterpolatedReversed();
00396
00397
00398
00401 void SetMoveWaypointLooping(bool loop);
00402
00404 bool GetMoveWaypointLooping();
00405
00408 void SetMoveWaypointReverseLooping(bool loop);
00409
00411 bool GetMoveWaypointReverseLooping();
00412
00414 void ClearMoveWaypoints();
00415
00417 irr::u32 GetNumMoveWaypoints();
00418
00420
00426
00427
00428 void AddMoveWaypoint(irr::core::vector3df point, irr::u32 time);
00429
00431 irr::f32 GetMoveWaypointInterpolationValue();
00432
00435 void SetScaleWaypointLooping(bool loop);
00436
00438 bool GetScaleWaypointLooping();
00439
00442 void SetScaleWaypointReverseLooping(bool loop);
00443
00445 bool GetScaleWaypointReverseLooping();
00446
00448 void ClearScaleWaypoints();
00449
00451 irr::u32 GetNumScaleWaypoints();
00452
00454
00460
00461
00462 void AddScaleWaypoint(irr::core::vector3df point, irr::u32 time);
00463
00465 irr::f32 GetScaleWaypointInterpolationValue();
00466
00469 void SetRotateWaypointLooping(bool loop);
00470
00472 bool GetRotateWaypointLooping();
00473
00476 void SetRotateWaypointReverseLooping(bool loop);
00477
00479 bool GetRotateWaypointReverseLooping();
00480
00482 void ClearRotateWaypoints();
00483
00485 irr::u32 GetNumRotateWaypoints();
00486
00488
00494
00495
00496 void AddRotateWaypoint(irr::core::vector3df point, irr::u32 time);
00497
00499 irr::f32 GetRotateWaypointInterpolationValue();
00500
00502 void AddChildTask(Task * t);
00503
00505 void RemoveChildTask(Task * t);
00506
00507 protected:
00508 DustyDriver * dustyDriver;
00509
00510 bool executeMultiple;
00511 bool removeNodeOnDestroy;
00512
00513 irr::u32 updateInterval;
00514
00515 EntityParentTask * parentTask;
00516
00517 EntityActionType currentMoveAction;
00518 EntityActionType currentScaleAction;
00519 EntityActionType currentRotateAction;
00520
00521 MoveTask * moveTask;
00522 RotateTask * rotateTask;
00523 ScaleTask * scaleTask;
00524 MoveInterpolatedTask * moveInterpolatedTask;
00525 ScaleInterpolatedTask * scaleInterpolatedTask;
00526 RotateInterpolatedTask * rotateInterpolatedTask;
00527 MoveBoundedTask * moveBoundedTask;
00528 ScaleBoundedTask * scaleBoundedTask;
00529 RotateBoundedTask * rotateBoundedTask;
00530 WaypointMoveInterpolatedTask * moveWaypointTask;
00531 WaypointScaleInterpolatedTask * scaleWaypointTask;
00532 WaypointRotateInterpolatedTask * rotateWaypointTask;
00533 };
00534 }
00535
00536 #endif