root/CS/trunk/include/ivaria/dynamicsdebug.h @ 33752

Revision 33752, 3.7 KB (checked in by kickvb, 6 months ago)

- Made the debug colliders be cleared when toggling mode of the dynamics debugger
- Added method to update the display of the dynamics debugger
- Added display of the static/kinematic colliders
- Added methods to choose the colors of the static/dynamic/kinematic colliders

  • Property svn:mime-type set to text/plain
  • Property svn:eol-style set to native
Line 
1/*
2  Copyright (C) 2010 Christian Van Brussel, Communications and Remote
3      Sensing Laboratory of the School of Engineering at the
4      Universite catholique de Louvain, Belgium
5      http://www.tele.ucl.ac.be
6
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  Library General Public License for more details.
16
17  You should have received a copy of the GNU Library General Public
18  License along with this library; if not, write to the Free
19  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21#ifndef __CS_IVARIA_DYNAMICSDEBUG_H__
22#define __CS_IVARIA_DYNAMICSDEBUG_H__
23
24/**\file
25 * Debugging of dynamic systems
26 */
27
28#include "csutil/scf.h"
29
30struct iDynamicSystemDebugger;
31struct iDynamicSystem;
32struct iSector;
33struct iMaterialWrapper;
34enum csBulletState;
35
36/**
37 * Creation of dynamic system debuggers.
38 */
39struct iDynamicsDebuggerManager : public virtual iBase
40{
41  SCF_INTERFACE(iDynamicsDebuggerManager, 1, 0, 0);
42
43  /**
44   * Create a new debugger.
45   */
46  virtual iDynamicSystemDebugger* CreateDebugger () = 0;
47};
48
49/**
50 * A class to help visualization and debugging of physical
51 * simulations made through the iDynamicSystem plugin.
52 */
53struct iDynamicSystemDebugger : public virtual iBase
54{
55  SCF_INTERFACE(iDynamicSystemDebugger, 1, 0, 1);
56
57  /**
58   * Set the dynamic system that has to be debugged.
59   */
60  virtual void SetDynamicSystem (iDynamicSystem* system) = 0;
61
62  /**
63   * Set the iSector where reside the meshes animated by the
64   * dynamic simulation.
65   */
66  virtual void SetDebugSector (iSector* sector) = 0;
67
68  /**
69   * Set whether the debug mode is active or not. If active, then all
70   * the meshes attached to a iRigidBody will be replaced by a new
71   * mesh with the size and transform of the bodies' colliders. It
72   * allows to see what is really happening at the physical simulation
73   * level.
74   * \param debugMode True to activate the debug mode, false to set
75   * back the initial meshes.
76   */
77  virtual void SetDebugDisplayMode (bool debugMode) = 0;
78
79  /**
80   * Update the list of colliders that are displayed. Call this when you have
81   * added or removed some dynamic bodies to/from the dynamic system.
82   */
83  virtual void UpdateDisplay () = 0;
84
85  /**
86   * Set the material to be used for the colliders of the rigid bodies that are
87   * in 'static' state. If 0 is passed then the rigid bodies in 'static' state
88   * won't be displayed. If this method is not used, then a default red colored
89   * material will be used.
90   */
91  virtual void SetStaticBodyMaterial (iMaterialWrapper* material) = 0;
92
93  /**
94   * Set the material to be used for the colliders of the rigid bodies that are
95   * in 'dynamic' state. If 0 is passed then the rigid bodies in 'dynamic' state
96   * won't be displayed. If this method is not used, then a default green colored
97   * material will be used.
98   */
99  virtual void SetDynamicBodyMaterial (iMaterialWrapper* material) = 0;
100
101  /**
102   * Set the material to be used for the colliders of the rigid bodies that are
103   * in the given state. If 0 is passed then the rigid bodies in the given state
104   * won't be displayed. If this method is not used, then a default blue colored
105   * material will be used.
106   */
107  virtual void SetBodyStateMaterial (csBulletState state,
108                                     iMaterialWrapper* material) = 0;
109};
110
111#endif // __CS_IVARIA_DYNAMICSDEBUG_H__
Note: See TracBrowser for help on using the browser.