[Plib-cvs] plib/doc/sg index.html,1.13,1.14
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2002-08-11 14:48:54
|
Update of /cvsroot/plib/plib/doc/sg In directory usw-pr-cvs1:/tmp/cvs-serv9317/plib/doc/sg Modified Files: index.html Log Message: Added documentation, inlined some functions. Index: index.html =================================================================== RCS file: /cvsroot/plib/plib/doc/sg/index.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- index.html 13 Jun 2002 05:53:02 -0000 1.13 +++ index.html 11 Aug 2002 14:48:50 -0000 1.14 @@ -870,6 +870,153 @@ void sgSetMat4 ( sgMat4 dst, sgdMat4 src ) ; void sgSetCoord ( sgCoord *dst, sgdCoord *src ) ; </pre> +<H3>Spring/Mass/Damper model.</H3> +Many applications can greatly benefit from some simple dynamics +modelling. SG includes two classes that taken together implement +a standard Spring-Mass-Damper model with Euler integration. +<pre> + + class sgParticle ; + class sgSpringDamper ; [...122 lines suppressed...] +accelleration due to gravity - and assume Z-is-up. But the 'Vec3' versions +make neither of those assumptions - so make sure the vector you give points +DOWNWARDS! +<p> +eg +<pre> + + sgSetGravity ( 1.6 ) ; /* On the Moon! */ + +</pre> +...but... +<pre> + + sgSetVec3 ( lunar_gravity, 0.0, 0.0, -1.6 ) ; /* Note minus sign! */ + sgSetGravityVec3 ( lunar_gravity ) ; + +</pre> <hr> <H2>Credits.</H2> Thanks to <A HREF="mailto:kev...@ya...">Kevin Thompson</A> |