Panda3D

physxForceFieldDesc.h

00001 // Filename: physxForceFieldDesc.h
00002 // Created by:  enn0x (06Nov09)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef PHYSXFORCEFIELDDESC_H
00016 #define PHYSXFORCEFIELDDESC_H
00017 
00018 #include "pandabase.h"
00019 #include "lvector3.h"
00020 #include "lpoint3.h"
00021 #include "lmatrix.h"
00022 
00023 #include "physxEnums.h"
00024 #include "physx_includes.h"
00025 
00026 class PhysxActor;
00027 class PhysxForceFieldShapeDesc;
00028 class PhysxForceFieldShapeGroup;
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //       Class : PhysxForceFieldDesc
00032 // Description : Descriptor class for force fields.
00033 ////////////////////////////////////////////////////////////////////
00034 class EXPCL_PANDAPHYSX PhysxForceFieldDesc : public PhysxEnums {
00035 
00036 PUBLISHED:
00037   INLINE PhysxForceFieldDesc();
00038   INLINE ~PhysxForceFieldDesc();
00039 
00040   INLINE void set_to_default();
00041   INLINE bool is_valid() const;
00042 
00043   void set_name(const char *name);
00044   void set_pos(const LPoint3f &pos);
00045   void set_mat(const LMatrix4f &mat);
00046   void set_hpr(float h, float p, float r);
00047   void set_coordinates(PhysxForceFieldCoordinates coordinates);
00048   void set_actor(PhysxActor *actor);
00049 
00050   void set_kernel_constant(const LVector3f &constant);
00051   void set_kernel_position_target(const LPoint3f &target);
00052   void set_kernel_position_multiplier(const LMatrix3f &multiplier);
00053   void set_kernel_velocity_target(const LVector3f &target);
00054   void set_kernel_velocity_multiplier(const LMatrix3f &multiplier);
00055   void set_kernel_torus_radius(float radius);
00056   void set_kernel_falloff_linear(const LVector3f &falloff);
00057   void set_kernel_falloff_quadratic(const LVector3f &falloff);
00058   void set_kernel_noise(const LVector3f &noise);
00059 
00060   void add_include_group_shape(PhysxForceFieldShapeDesc &shapeDesc);
00061   void add_shape_group(PhysxForceFieldShapeGroup *group);
00062 
00063 public:
00064   void create_kernel(NxScene *scenePtr);
00065 
00066   NxForceFieldDesc _desc;
00067   NxForceFieldLinearKernelDesc _kernel;
00068 
00069 private:
00070   string _name;
00071 };
00072 
00073 #include "physxForceFieldDesc.I"
00074 
00075 #endif // PHYSXFORCEFIELDDESC_H
 All Classes Functions Variables Enumerations