Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/buerli/src/IPhys.cc @ 2776

Last change on this file since 2776 was 2617, checked in by adrian, 20 years ago

orxonox/branches/buerli: Addition of Class IPhys (Physical Engine). WorldEntity is not yet inherited from it. The interface of IPhys is quite detailed, but the implementation is mostly dummy code.

File size: 2.3 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Adrian Buerli
13*/
14
15#include <iostream>
16
17#include "IPhys.h"
18#include "stdincl.h"
19
20using namespace std;
21
22IPhys::IPhys ()
23{
24}
25
26IPhys::~IPhys ()
27{
28}
29
30// Simulation
31void IPhys::simIterate(Uint32 deltaT){
32        switch (behav) {
33        case B_MASS_POINT:
34        break;
35        case B_RIGID_BODY:
36        break;
37        case B_ELAST_BODY:
38        break;
39        case I_SPRING_LINEAR:
40        break;
41        case I_DMPSPR_LINEAR:
42        break;
43        case I_SPRING_MOMENTUM:
44        break;
45        case I_DMPSPR_MOMENTUM:
46        break;
47        case F_GRAVITY:
48        break;
49        case F_HOVER:
50        break;
51        case F_SHOCKWAVE:
52        break;
53        case F_BEAM:
54        break;
55        default:;
56        }
57};
58
59       
60// Exertion of external forces
61void IPhys::exertForce( Vector force ){
62        resForce = resForce + force;
63};
64
65void IPhys::exertMomentum( Vector Momentum ){
66        resMomentum = resMomentum + Momentum;
67};
68
69// set attributes       
70void IPhys::setBehaviour( IPHYS_BEHAVIOUR desiredBehaviour ){
71        behav = desiredBehaviour;
72};
73
74void IPhys::setBody( float mass ){
75        m = mass;
76};
77
78void IPhys::setBody( float mass, float inertMoment[] ){
79        m = mass;
80        //inertM = inertMoment;
81};
82
83void IPhys::setBody( float mass, float inertMoment[], float YoungsModulus ){
84        m = mass;
85        //inertM = inertMoment;
86        YE = YoungsModulus;
87};
88       
89void IPhys::setMounts( WorldEntity *point1, WorldEntity *point2 ){
90        mounts[0] = point1;
91        mounts[1] = point2;
92};
93
94void IPhys::setSpring( float neutralLength, float springConst ){
95        spNeutralL = neutralLength;
96        spConst = springConst;
97};
98
99void IPhys::setSpring( float neutralLength, float springConst, float damping ){
100        spNeutralL = neutralLength;
101        spConst = springConst;
102        dmp = damping;
103};
104
105void IPhys::setSpring( Quaternion neutralOrientation, float springConst ){
106        mspNeutralOri = neutralOrientation;
107        spConst = springConst;
108};
109void IPhys::setSpring( Quaternion neutralOrientation, float springConst, float damping ){
110        mspNeutralOri = neutralOrientation;
111        spConst = springConst;
112        dmp = damping;
113};
114
115   
Note: See TracBrowser for help on using the repository browser.