TempleOSCDV4.06.ISO
This commit is contained in:
1 parent
6fe38d2d9d
commit
b632ab9a4f
261 files changed
+6282
-5801
No files matched your search
@@ -0,0 +1,43 @@
|
||||
class MyMass:CMass
|
||||
{
|
||||
F64 radius;
|
||||
};
|
||||
|
||||
class MySpring:CSpring
|
||||
{
|
||||
};
|
||||
|
||||
CMathODE *ode=NULL;
|
||||
|
||||
U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
|
||||
{
|
||||
MyMass *tempm1,*tempm2;
|
||||
|
||||
tempm1=ode->next_mass;
|
||||
while (tempm1!=&ode->next_mass) {
|
||||
tempm2=tempm1->next;
|
||||
while (tempm2!=&ode->next_mass) {
|
||||
tempm2=tempm2->next;
|
||||
}
|
||||
tempm1=tempm1->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 Init()
|
||||
{
|
||||
ode=ODENew(0,1e-4,ODEF_HAS_MASSES);
|
||||
ode->derivative=&MyDerivative;
|
||||
ode->drag_v2=0.002;
|
||||
ode->drag_v3=0.00001;
|
||||
ode->acceleration_limit=5e3;
|
||||
|
||||
QueIns(ode,Fs->last_ode);
|
||||
}
|
||||
|
||||
U0 CleanUp()
|
||||
{
|
||||
QueRem(ode);
|
||||
QueDel(&ode->next_mass,TRUE);
|
||||
QueDel(&ode->next_spring,TRUE);
|
||||
ODEDel(ode);
|
||||
}
|
||||
Reference in new issue
Block a user