timewarp rigid body simulation - computer graphics · though a continuous process, exhibits many...

8
Timewarp Rigid Body Simulation Brian Mirtich MERL - A Mitsubishi Electric Research Lab Figure 1: Avalanche: 300 rocks tumble down a mountainside. Abstract The traditional high-level algorithms for rigid body simulation work well for moderate numbers of bodies but scale poorly to sys- tems of hundreds or more moving, interacting bodies. The problem is unnecessary synchronization implicit in these methods. Jeffer- son’s timewarp algorithm [22] is a technique for alleviating this problem in parallel discrete event simulation. Rigid body dynamics, though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used in a uniprocessor rigid body simulator to give substantial performance improvements for simulations with large numbers of bodies. This paper describes the limitations of the traditional high-level simula- tion algorithms, introduces Jefferson’s algorithm, and extends and optimizes it for the rigid body case. It addresses issues particular to rigid body simulation, such as collision detection and contact group management, and describes how to incorporate these into the time- warp framework. Quantitative experimental results indicate that the timewarp algorithm offers significant performance improvements over traditional high-level rigid body simulation algorithms, when applied to systems with hundreds of bodies. It also helps pave the way to parallel implementations, as the paper discusses. CR Categories: I.3.7 [Computer Graphics]: Three-Dimensional Graphics and Realism—Animation; I.6.8 [Simulation and Modeling]: Types of Simulation— Continuous, Discrete Event, Animation Keywords: Physics Based Modeling, Animation. 1 Introduction Today rigid body simulation is a mature technology. The major components have been well studied and made practical: fast, ro- [email protected] bust collision detection algorithms [10, 17, 21, 27]; impact models of varying accuracy [8, 12, 31]; methods to enforce general motion constraints [6, 37], especially the ubiquitous non-penetration con- straints [3, 4, 35, 36]; and control strategies for articulated bodies [19, 20, 28, 32]. Thus rigid body simulation is available in many an- imation and CAD packages and used in computer games. Yet areas for significant improvement remain. An important one is increasing the number of moving, interacting bodies that can be simulated. We are concerned with general rigid body simulation, meaning that the bodies have nontrivial geometries, all pairs can potentially collide, and second-order physics governs the motion. There are numerous techniques to simulate large numbers of rigid bodies by relaxing some of these assumptions. Milenkovic efficiently simu- lates vast numbers of interacting spheres and non-rotating polyhe- dra using linear programming techniques and zeroeth-order physics [25]. Carlson and Hodgins use different motion levels of detail, from fully dynamic to fully kinematic, to obtain an order of mag- nitude increase in the number of legged creatures that can be simu- lated in real time [11]. Chenney et. al. cull dynamics computations for off-screen objects; when they enter the field of view initial states are computed by sampling a probability distribution over their state space [13]. Brogan et. al. simulate large herds of fully dynamic agents in distributed virtual environments, but without full collision detection [9]. Despite these excellent techniques, the general case is worth pursuing because of its wide applicability; sometimes full collision detection and dynamics cannot be avoided. Traditional techniques for the general problem become ineffi- cient and even intractable with many-bodied systems for one of two reasons. Either the integration steps 1 become very small, or the amount of work that is wasted because of unpredictable events (like collisions) becomes very large. The problems are not in the component algorithms but in the glue holding them together—the high-level simulation loop. It imposes a synchronization between bodies that is usually unnecessary and wasteful. These problems are explored in depth in Section 2. Jefferson’s timewarp algorithm [22], discussed in Section 3, is an elegant paradigm designed to alleviate similar problems in parallel discrete event simulation by running processes as asynchronously as possible. An optimistic, non-interaction assumption prevails, and when it is violated only the computation that is provably invalid is undone. Although rigid 1 Throughout this paper, integration step means the time interval passed to the integrator, not the smaller steps it may take internally.

Upload: others

Post on 20-Aug-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Timewarp Rigid Body Simulation - Computer Graphics · though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used

Timewarp Rigid Body Simulation

BrianMirtich�

MERL - A MitsubishiElectricResearchLab

Figure1: Avalanche: 300rockstumbledown amountainside.

AbstractThe traditional high-level algorithms for rigid body simulationwork well for moderatenumbersof bodiesbut scalepoorly to sys-temsof hundredsor moremoving, interactingbodies.Theproblemis unnecessarysynchronizationimplicit in thesemethods.Jeffer-son’s timewarp algorithm [22] is a techniquefor alleviating thisproblemin paralleldiscreteeventsimulation.Rigidbodydynamics,thougha continuousprocess,exhibits many aspectsof a discreteone. With modification,the timewarp algorithmcanbe usedin auniprocessorrigid bodysimulatorto give substantialperformanceimprovementsfor simulationswith largenumbersof bodies.Thispaperdescribesthelimitationsof thetraditionalhigh-level simula-tion algorithms,introducesJefferson’s algorithm,andextendsandoptimizesit for therigid bodycase.It addressesissuesparticulartorigid bodysimulation,suchascollisiondetectionandcontactgroupmanagement,anddescribeshow to incorporatetheseinto thetime-warpframework. Quantitativeexperimentalresultsindicatethatthetimewarp algorithm offers significantperformanceimprovementsover traditionalhigh-level rigid bodysimulationalgorithms,whenappliedto systemswith hundredsof bodies.It alsohelpspave theway to parallelimplementations,asthepaperdiscusses.

CR Categories: I.3.7 [ComputerGraphics]: Three-DimensionalGraphicsandRealism—Animation; I.6.8 [Simulation and Modeling]: Types of Simulation—Continuous,DiscreteEvent,AnimationKeywords: PhysicsBasedModeling,Animation.

1 Intr oductionToday rigid body simulationis a maturetechnology. The majorcomponentshave beenwell studiedandmadepractical: fast, ro-�[email protected]

bustcollisiondetectionalgorithms[10, 17, 21, 27]; impactmodelsof varyingaccuracy [8, 12, 31]; methodsto enforcegeneralmotionconstraints[6, 37], especiallythe ubiquitousnon-penetrationcon-straints[3, 4, 35, 36]; andcontrol strategiesfor articulatedbodies[19,20, 28, 32]. Thusrigid bodysimulationis availablein many an-imationandCAD packagesandusedin computergames.Yetareasfor significantimprovementremain.An importantoneis increasingthenumberof moving, interactingbodiesthatcanbesimulated.

We areconcernedwith general rigid bodysimulation,meaningthatthebodieshave nontrivial geometries,all pairscanpotentiallycollide, andsecond-orderphysicsgovernsthe motion. Therearenumeroustechniquesto simulatelargenumbersof rigid bodiesbyrelaxingsomeof theseassumptions.Milenkovic efficiently simu-latesvastnumbersof interactingspheresandnon-rotatingpolyhe-drausinglinearprogrammingtechniquesandzeroeth-orderphysics[25]. Carlsonand Hodginsusedifferent motion levels of detail,from fully dynamicto fully kinematic,to obtainanorderof mag-nitudeincreasein thenumberof leggedcreaturesthatcanbesimu-latedin realtime[11]. Chenney et.al. cull dynamicscomputationsfor off-screenobjects;whenthey enterthefield of view initial statesarecomputedby samplingaprobabilitydistributionover theirstatespace[13]. Broganet. al. simulatelarge herdsof fully dynamicagentsin distributedvirtual environments,but withoutfull collisiondetection[9]. Despitetheseexcellenttechniques,thegeneralcaseis worth pursuingbecauseof its wide applicability;sometimesfullcollisiondetectionanddynamicscannotbeavoided.

Traditional techniquesfor the generalproblembecomeineffi-cient and even intractablewith many-bodiedsystemsfor one oftwo reasons.Either the integrationsteps1 becomevery small, ortheamountof work that is wastedbecauseof unpredictableevents(like collisions)becomesvery large. The problemsarenot in thecomponentalgorithmsbut in the glueholding themtogether—thehigh-level simulationloop. It imposesa synchronizationbetweenbodiesthat is usuallyunnecessaryandwasteful. Theseproblemsareexploredin depthin Section2. Jefferson’s timewarp algorithm[22], discussedin Section3, is an elegant paradigmdesignedtoalleviate similar problemsin paralleldiscreteevent simulationbyrunningprocessesasasynchronouslyas possible. An optimistic,non-interactionassumptionprevails, andwhenit is violatedonlythecomputationthat is provably invalid is undone.Althoughrigid

1Throughoutthis paper, integration stepmeansthetime interval passedto theintegrator, not thesmallerstepsit maytake internally.

ACM Copyright Notice
Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.
Page 2: Timewarp Rigid Body Simulation - Computer Graphics · though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used

bodydynamicsis a continuousprocess,it exhibits many traitsof adiscrete� process.With somemodification,thetimewarpalgorithmcanbe usedin rigid body simulators,improving both their speedandscalability. Themethodis describedin Section4, andSection5presentsresultsfrom anactualimplementation.

Timewarp rigid body simulationalso supportsthe long-rangegoal of a highly parallel implementation.Rigid body simulationoffers unlimitedpotentialfor modelingthe complex andunantici-patedinteractionsof rich virtual environments,but currenttechnol-ogy cannotsupportthis. Meetingthis challengewill certainlyre-quirea multiprocessorapproach,with perhapshundredsof proces-sorscomputingmotion throughouttheenvironment.Sucha simu-lation farm is akin to therenderingfarmsthatgeneratetoday’shighqualitycomputeranimation.Section6 toucheson theseissues.

2 Simulation Discontin uities

Thedominatingcomputationin arigid bodysimulatoris thatof nu-mericallyintegratingthedynamicstatesof bodiesforwardin time.Thedifferentialequationsof motionhavebeenknown for centuries;thetruedifficulty lies in processingsimulationdiscontinuities,heredefinedaseventsthat changethe dynamicstatesor the equationsof motion of somesubsetof the bodies. Examplesinclude col-lisions, new contacts,transitionsbetweenrolling andsliding, andcontrol law changes.Integratorscannotblithely passthroughdis-continuities.Insteadthe integrationmustbestopped,thestatesorequationsof motionupdated,andthentheintegratorrestartedfromthatpoint. Compoundingthiscomplicationis thefactthatthetimesof mostdiscontinuitiesareimpossibleto predict.Thustheintegra-tion mustbeinterruptedevenmorefrequentlythantherateatwhichdiscontinuitiesoccur, just to check if they haveoccurred.Therearetwo commonapproachesfor copingwith discontinuities,both ofwhichhavebeenshown practicalfor moderatenumbersof bodies.

2.1 Retroactive Detection

Retroactive detection(RD) is the mostcommonapproachto han-dling discontinuities.Thesimulatortakessmallstepsforwardandchecksfor discontinuitiesafter eachstep [2, 23]. For example,inter-body penetrationindicatesthat a collision occurredat sometimeduringthemostrecentintegrationstep.A rootfindingmethodlocalizesthe exact momentof the discontinuity. After resolution,theintegrationis restartedfrom thatpoint. All of thebodiesmustbebackedupto theirstatesat thetimeof thediscontinuitybecause(1)thediscontinuitymayhave affectedtheir motion,and(2) thebod-iesdirectly involved in thediscontinuitymustcertainlybe backedup to this time, andthereis no framework for maintainingbodiesat differenttimes—thebodiesmustbekeptsynchronized.Thefirstproblemis avoidableby boundinga discontinuity’s influence. Acertaincollision mayprovably have no influenceon themotionofa distantbodyover thecurrentintegrationstep.However, thesec-ondproblemis fundamentalto RD. It doesnot suffice to maintainstatesat two differenttimes,the time of the discontinuityandthetimeat theendof thestep,becausemultiplediscontinuitiescanoc-cur at differenttimesin a singlestep. Also, earlierdiscontinuitiesmaycauseor prevent laterones,andit is hardto determinewhichoneoccurredfirst without localizingthetimesof each.In practice,all bodiesarebacked up to the point of eachdiscontinuity. Thismethodis correctsinceit eventuallyprocessesall realdiscontinu-ities andno spuriousones,andBaraff hasshown it to be efficientandeminentlypracticalfor moderatenumbersof interactingbodies[5]. As thenumberof bodiesincreases,sodoesthetherateof dis-continuities,andthewastedwork perdiscontinuityincreasessincemorebodiesmustbebacked up. Shrinkingthestepsizeto reducetheamountof backupis nota goodsolutionaswe shallsee.Even-tually RD becomesintractabledueto theamountof wastedwork.

2.2 Conser vative Advancement

Conservative advancement(CA) is an alternative to RD basedonthe idea of never integrating over a discontinuity. Conservativelowerboundsonthetimesof discontinuitiesaremaintainedin apri-ority queuesortedby time, andthe simulatorrepeatedlyadvancesall simulatedbodiesto theboundatthefront of thequeue.Thesim-ulator tendsto creepup to eachdiscontinuity, takingsmallerstepsasit getscloser. Von Herzenet.al. usethis approachto detectcol-lisionsbetweentime-dependentparametricsurfaces[18], andMir-tich usesit to supportimpulse-basedsimulation[26]. Snyderet.al.usea relatedapproachto locatemulti-point collisionsby usingin-terval inclusionsto boundsurfacesin time andspace[33]. Finally,CA formsthebasisfor kineticdatastructurespioneeredby Bascheet.al. [7]. Theseareusedto solveahostof problemsfrom dynamiccomputationalgeometry, suchasmaintainingtheconvex hull of amoving point set,by maintainingboundson whenthecombinato-rial structuremaychange.For rigid bodysimulationtheadvantageof CA is that it doesnot wastework by integratingbodiesbeyonda discontinuity. Unfortunately, asthe numberof bodiesincreasestheaveragetime to thenext discontinuitycheckdecreases,andtheproblemis exacerbatedsinceit is difficult to computetight boundson timesof collisionsandcontactchanges.Stoppingthe integra-tion of all bodiesateachcheckis very inefficient,andCA becomesintractablewith many bodies.

2.3 Step Sizes and Efficienc y

Figure2 graphicallydemonstratestheproblemwith small integra-tion steps. It shows the computationalcostof computingthe 10-secondtrajectoryof a ballistic, tumbling brick usinga fifth orderadaptive Runge-Kutta integrator[30] undervariousstepsizes.Thetwo qualitatively similar curvescorrespondto different integratorerrortolerances.At smallstepsizestheintegratordoesnotneedtosubdivide the integrationstepinto smallerpiecesto meettheerrortolerance.Thuscomputationis proportionalto thenumberof invo-cations:halvingthestepsizedoublesthework. At largestepsizestheintegratorbreakstherequestedstepinto smallerpiecesto meettheerror tolerance,socomputationis insensitive to stepsize. Un-fortunately, even with a moderatenumberof bodies,a simulator’soperatingpoint is to the left of the elbow in thesecurves. Thus,reducingthestepsizesignificantlyincreasescomputationalcost.

1E+05

1E+06

1E+07

1E+08

1E-04 1E-03 1E-02 1E-01 1E+00 1E+01

com

puta

tiona

l cos

t (flo

ps)

integration timestep (seconds)

Brick Integration Experiment

(30 Hz)

eps=1.0E-4

eps=1.0E+0

Figure2: Costof computingthe trajectoryof a brick versusinte-grationstepsize(epsis theintegratorerrortolerance).

3 The Timewarp Algorithm

Theproblemsof RD andCA resultfrom unnecessarysynchroniza-tion. Eachdiscontinuityaffectsonly asmall fractionof thebodies,

Page 3: Timewarp Rigid Body Simulation - Computer Graphics · though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used

yet underRD every bodymustbebackedup whena discontinuityoccurs,� andunderCA integrationof everybodymuststopfor adis-continuitycheck. The inefficienciesaretolerableaslong astherearenot too many bodies.Similar issuesarisein discreteeventsim-ulation (DES) , which is often appliedto very large modelssuchas carson a freeway system. Thesesimulationsare often donein parallelor distributedsettings.The simulatedagentsareparti-tionedamonga numberof processors,eachof which advancesitsagentsforwardin time. Therearecausalityrelationshipsthatmustbepreserved (e.g. a carsuddenlybrakingcausesthecarbehinditto brake), andthe crux of the problemis that oneagentmay trig-geranactionof anotheragenton a differentprocessor. Obviouslycommunicationby messagepassingor othermeansis needed.

Conservative DESprotocolsguaranteecorrectnessby requiringthat eachprocessoradvanceits agentsforward to a certain timeonly whenit hasprovably received all relevant eventsfrom otherprocessorsoccurringbeforethat time. Optimistic protocolswerea key breakthroughin distributedDES.Theseallow eachproces-sor to advanceits agentsforward in time by assumingall relevanteventshavebeenreceived,therebyavoiding idle time. Thecatchisthatwhenanagentreceivesanevent in its “past,” theagentneedsto bereturnedto thestateit wasin whentheeventoccurred,its ownactionssincethattimemustbeundone,andtheinterveningcompu-tationis wasted.Jeffersonwasamongthefirst to definea provablycorrect,optimistic synchronizationprotocolalong with a simple,elegantimplementationcalledthe timewarp mechanism[22]. Wenow give abrief, simplifieddescriptionof thisseminalalgorithm.

Eachprocessmaintainsthe stateof someportion of the mod-eledsystem.Eachprocessalsohasa local clock measuringlocalvirtual time (LVT) at that process.The local clocksare not syn-chronized,andprocessescommunicateonly by sendingmessages.Every messageis time stamped2 with a time not earlier than thesender’s LVT but possiblyearlierthanthereceiver’s LVT whenthemessageis received. Processesmustprocesseventsin time orderto maintaincausalityconstraints.Whena received messagehasatimestamplater thanthereceiver’s LVT, it is insertedinto an inputqueuesortedby timestamp.A process’s basicexecutionloop is toadvanceLVT to thetimeof thefirst eventin its inputqueue,removetheevent,andprocessit. Advancingto a new time meanscreatinganew state,andthesearequeuedin timeorderin astatequeue.

If the first event in a process’s input queuehasa receive timeearlier thanLVT, the processperformsa rollback by returningtothelateststatein its statequeuebeforetheexceptionalevent’s time.Thisbecomesthenew currentstate,its timebecomesthenew LVT,and all subsequentstatesin the queueare deleted. Already pro-cessedeventsoccurringafter the new LVT areplacedback in theinput queue. Messagesthe processorsent to other processesattimesafter the new LVT are “unsent” via antimessages. Whenaprocesssendsamessage,it addsacorrespondingantimessageto itsoutputqueue.This is anegativecopy of thesentmessage,identicalto it exceptfor a flippedsignbit. Whena processis rolled backtoanew LVT, all antimessagesin theoutputqueuelaterthanthis timearesent.Whenamessageandantimessageareunitedin aprocess’sinputqueue,they annihilateoneanother, andtheneteffect is asif amessagewerenever sent.Rollbackis recursive: antimessagesmaytriggerrollbacksthatgeneratenew antimessages.

Global virtual time (GVT) is the minimum of all LVTsamongtheprocessesandall timesof unprocessedmessages.It representsaline of commitmentduringthesimulation:statesearlierthanGVTareprovablyvalid while statesbeyondGVTaresubjectto rollback.Individual LVTsoccasionallyjump backwards,but GVTmonoton-ically increases.Sincerollbacknever goesto a point beforeGVT,eachstatequeueneedsonly to maintainonestatebeforeGVT. Ear-lier statesaswell assavedmessagesprior to GVTmaybedeleted.

2Eachmessageactuallyhastwo timestamps,a sendandreceive time,but onesufficesfor ourpurposes.

4 Timewarp Rigid Bod y Simulation

Rigid bodysimulationcomputesa continuousprocessbut exhibitstraits of DES. Bodies“communicate”throughcollisionsandper-sistentcontact. Collisionsarein fact usuallymodeledasdiscreteevents.Contactis a continuousphenomenon,but it canbeviewedasoccurringwithin acollectionof bodiesratherthanbetweenindi-vidual bodies.This view facilitatestheadaptationof thetimewarpalgorithm to uniprocessorrigid body simulation. The result is ahigh-level simulationalgorithmthatdoesnotsuffer fromthewastedwork problemof RD nor thesmalltimestepproblemof CA.

4.1 Overview

Firstconsiderasimulationwithoutconnectedor contactingbodies.Eachbody is a separatetimewarpprocesswith a statequeuecon-tainingthedynamicstate(positionandvelocity) of thebodyat theendof eachintegrationstep.Thetimesof thesestatesaredifferentfor differentbodies. A global event queuecontainseventsfor allsimulatedbodies;this correspondsto a unionof all the individualinput queuesin Jefferson’s algorithm.Eacheventhasa timestampanda list of the bodiesthat receive it. One iterationof the mainsimulationloopconsistsof removing theeventfrom thefront of theevent queue,integratingthe receiving bodyor bodiesto the eventtime, andthenprocessingthe event. Most eventsarerescheduledafterthey areprocessed.Oursystemsupportsfour typesof events:

1. Collisioncheck eventsarereceivedby pairsof bodies,causinga collision checkto beperformedbetweenthemat thegiventime. Processingtheseeventsmayleadto collisionresolution.

2. Group check eventstrigger collision checkingbetweencon-tactingbodiesandalsocheckingfor whengroupsof suchbod-iesshouldbesplit. They canalsoleadto collisionresolution.

3. Redraw eventsexist for every renderedbody. Processingoneinvolveswriting thecurrentpositionof thebodyto arecordingbuffer. Reschedulingoccursatfixedframeintervals.

4. Callback eventsarereceivedbyarbitrarysetsof bodiesandin-vokeuserfunctionswrittenin Schemethat,for example,drivecontrolsystems.Reschedulingis user-specified.

4.2 Collisions and Rollbac k

If penetrationis discoveredin processingacollisioncheckor groupcheckevent, thena collision hasoccurredat a time precedingthetimeof theevent.Thismaybeanormalcollisionor asoftcollisionproducinga new persistentcontact.Eitherway, thecolliding bod-iesmustberolled backto thecollision time. This behavior differsfrom thatof standardtimewarpeventswhichonly causerollbackupto thetime of theevent; it occursin rigid bodysimulationbecauseexact collision timescannotbe predicted.To implementcollisionrollback eachcollision checkandgroupcheckevent hasan addi-tional timestamp,a safetime, which is the time whenthe pair orgroupof bodieswaslast verified to be disjoint. Whena collisioncheckor groupcheckevent is processed,andthereis no penetra-tion, thesafetime is updatedto thetimeof thecheck.Whenpene-trationis detected,thesafetime formsa lowerboundon thesearchfor thecollision time. Sincerollbacknever proceedsto a point be-fore the safetime, GVT canbe computedas the minimum of allLVTsandall eventsafetimes. This insurestherearealwaysstatesto backup to whenacollisionoccurs.

Theantimessagemechanismis moregeneralthanwhatis neededfor uniprocessorrigid bodysimulation.Still consideringonly iso-latedbodies,the only inter-body communicationis throughcolli-sions;a suitablerecordof thesedrivesthe rollback. Pairs of cor-

Page 4: Timewarp Rigid Body Simulation - Computer Graphics · though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used

respondingpost-collisionstatesarelinkedtogether, turningthein-dividual

�statequeuesinto a dynamicstategraph asshown at the

top of Figure3. The figure depictsthe actionstaken whenbod-ies � and � collide. Body � is rolled backby deletingall of itsstatesafter the post-collisionstate. (If � alsohadsuchstates,atwin rollbackoperationwould begin in its own statequeue).Someof thedeletedstatesarelinkedvia collisionsto statesin otherbod-ies. Theseinter-bodycommunicationsarenow suspectdueto the� - � collision,thusrollbackproceedsacrossthecollision links andthenrecursively forwardthroughotherbodies’statequeues.Uponcompletionof rollback,all statesthatwerepossiblyaffectedby the� - � collision—andno others—aredeleted. In this exampletherollback invalidatesa substantialamountof work. It is anunusualcasebut onethesimulatormustbepreparedfor.

time

A

B

C

D

E

frontier

GVT

collision

time

A

B

C

D

E

old frontier

old GVT

new frontier

new GVT

Figure3: Top: Stategraphof a five body simulation. The verti-cal connectionslink post-collisionstates.Thegraystatesarenewpost-collisionstatesfoundwhileprocessingan � - � collisioncheckevent. Bottom: The rollback operationtriggeredby the collision.Crossedstatesaredeletedandrepresentwastedwork, but forwardprogressis indicatedby theadvancementof GVT.

Eventsmust alsobe rolled back. This correspondsto placingmessagesbackin aprocess’s inputqueuein Jefferson’s originalal-gorithm.An eventneedsto berolledbackonly if it involvesabodywhosestatequeuewasrolled backto a timeearlierthanthesched-uled time of the event. Event rollback is type-specific. Redraweventsaresimply rescheduledto thefirst frametime following therollbacktime. Fixed-ratecallbackeventsarehandledsimilarly. Iftherollbacktime is earlierthanthesafetimeof acollisioncheckorgroupcheckevent,theeventis rescheduledto therollbacktime. Iftherollbacktime is betweenthesafetime andthescheduledeventtime,thesystemoptimisticallyassumesnoactionis necessary. Thisis a gamblesincea collision may make the previously computedcollisionchecktime inaccurate,but thetimewarpalgorithmcanre-covergracefullyfrom poorlypredictedcollision times.

In total the timewarpalgorithmrequireslittle overheadandfew

additionaldatastructureswhencomparedto a conventionalsimu-lator. Any simulatorcomputessequencesof bodystates;themainchangeis that thesearekept in queuesand linked togetherat thecollision points. Rollbackis implementedwith a simplerecursivetraversalof thestategraph.

4.3 Multibodies

Multibodies(or articulatedbodies)arecollectionsof rigid bodiesconnectedby joints, asin a humanfigure. The trajectoryof a sin-gle multibody link cannotbe determinedin isolation; the motionof all links must be computedtogether. Little changeis neededto incorporatemultibodiesinto thetimewarpframework. A singlestatequeueservesfor theentiremultibody;it is advancedasaunit.Most eventsarestill handledon a per rigid body (per link) basis.When,for example,a particularmultibodylink mustbeintegratedto a certaintime for acollisioncheck,thewholemultibodyis inte-gratedto that time. As a result,statesaremoredenselydistributedalongmultibody statequeuesthanalongrigid body statequeues,especiallyfor multibodieswith many links. A collision involving asinglelink causesthe wholemultibody to be rolled back. Clearlytimewarpdoesnot offer muchimprovementif all of thebodiesareconnectedinto only a few multibodies.

4.4 Contact Groups

Contactgroupsarecollectionsof rigid bodiesandmultibodiesinpersistentcontact;the componentbodiesexert continuousforceson eachother. Thecomponentsmustagainbeintegratedasa unit,but unlike multibodiescontactgroupsarefluid: bodiesmayjoin orleave groups,andgroupsarecreatedanddestroyed during a sim-ulation. Contactgroupshave no analogin the classicaltimewarpalgorithm,which is designedfor a staticsetof processes.Most oftheaddedwork in implementingtimewarprigid bodysimulationisin managingcontactgroups.To impartsomeorderwe requirethatgroupscomprisea fixedsetof bodies;whenthesetmustchangeanew groupis created.Groupsarecreatedby fusionsandfissions.Afusion is a suitablysoft collision betweentwo bodies,afterwhichthey areconsideredto remainin contact.Eitherbodymaybepartofamultibodyor anothergroup.A fissionis asplittingof agroupintotwo or moreisolatedbodiesor separate(non-contacting)groups.

Thecomplexities of contactgroupevolution arebestexplainedby example.Thetopof Figure4 showsthestategraphfor fiverigidbodieslabeled� - � andthe variouscontactgroupsthatexist overthetimeinterval ��� ����� (body � doesnothaveastatequeuesinceitisfixed).Thebottomof thefiguredepictsthephysicalconfigurationatthreedistincttimes.At time �� , onlybodies� and � areisolated;theothersaremembersof twocontactgroups,��� and ����� . Onlykinematicallycontrolledbodies,of whichfixedbodiesareaspecialcase,may be membersof multiple groupsat a given time; suchbodiesdonot link groupstogethersincetheirmotionandtheforcesthey exert on other bodiesare independentof the forcesexertedon them.Dottedhorizontallinesindicateintervalswithout isolatedstatessincethebodyis partof agroup.Thefirst changeafter �� is afusioncollisionbetween� and � , creatinganew group, ����� . �and � thencollide,but this is astandard(non-fusion)collisionso �remainsisolatedand ����� intact.The � - � collisiondoesset � inmotion,eventuallyleadingto an � - � fusioncollision. This lattercollisioncausestwo previouslyseparategroupsto fuseinto asingleone,which is thesituationat time �� . Next � breakscontactwith� , triggeringthe fissionof ��������� into ������� and ��� . Nocollision occurredhere;fissionscanbecausedsimply by breakingcontacts.Still sliding, � pushes� off of � , causing� to leave thecontactgroupandreturnto an isolatedstate.Finally, � landsandsettlesonto � , fusinginto anew group ������� .

Page 5: Timewarp Rigid Body Simulation - Computer Graphics · though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used

time

A

B

C

D

E

AF

CDF

ABF

B joinsAF

fission ofABCDF

ABCDF

ABDF

CF

ADF

ADEF

fusion ofCDF & ABF

B leavesABDF

E joinsADFt0 t1 t2

B

D

D

D

A

B

E

B CC CE

A A

E

F (fixed) F (fixed) F (fixed)

t0 t1 t2

Figure4: Top: The stategraphfor a portion of a six body sim-ulation. Circles are isolatedbody statesand squaresare contactgroupstates.Bottom: Thephysicalconfigurationof the bodiesatthreedistinct times. Moving bodiesin contactgroupsarecoloredto matchthetoppartof thefigure.Seetext for details.

The stategraphin the figure only shows statesrelevant to thediscussion.Therewould actuallybemany morestatesalongall ofthestatequeuesgeneratedby othereventsanddiscontinuities.Forexamplethereare usually many non-fusioncollisions leadingupto a fusioncollision asbodiessettle. At any time coordinateeachnon-kinematicbody is isolatedor a memberof exactly onegroup.Thusthereis never ambiguityaboutwhat thestateof a body is ata given time, or from which stateto integratewhencomputinganew stateof a body. To computethe stateof body � at time �� ,integrationproceedsfrom the latestisolatedstateof � prior to � .To computethe stateof � at time �� , integrationproceedsfromthelateststateof group ��������� prior to �� . To facilitatethis, thestategraphhasadditionalpointersnotshown in thefigure.A fusioncollision pointsto the new groupit creates,if any. Also, the laststateof everyfissuredgrouppointsto thenewly isolatedbodiesandsubgroupsthatsucceedit. Thesepointersmake it possibleto findfor any body � andtime thelateststateof � , possiblyin agroup,prior to . Thesearchbeginswithin � ’s own (isolated)statequeueandextendsinto contactgroupsif necessaryby following pointers.Sometimesseveral pointersandcontactgroupsmustbe traversedto find theproperprior state.Thepointersalsofacilitaterollback.Whenafusioncollisionstateis deleted,therollbackproceedsto thenew groupformedby the collision, if any. Whenthe last stateofa fissuredgroupis deleted,rollbackproceedsto the isolatedbodyandsubgroupstatesthatsucceededit.

Over theinterval shown in Figure4, six new contactgroupsarecreatedin addition to the two that existedat �� . At �� only tworemain.Groupsareterminatedwhenthey fuseinto new groupsorwhenthey fissureinto pieces.Terminationdoesnotmeanthegroupcanbe deletedsincerollback cancauseevent processingin non-temporalorder. For exampleit maybenecessaryto determinethestateof body � at time �� after thegroup ��������� is terminated.OnceGVTpassesthelaststatein a terminatedgroup,however, thegroupis obsoleteandthestoragecanbereclaimed.A groupis alsodeletedwhena rollbackoperationannihilatesall of its states.

Intra-groupcollision detectionis handledin one of two ways.If bodies� and � arein thesamegroupbut not currentlyin con-tact, the standard� - � collision checkevent triggerscollision de-tectionbetweenthem. Eachgrouphasa group checkevent thatperformsall of the collision detectionbetweenalreadycontactingbodies.Thedistinctionis neededsincemostcollision time predic-tors do not computemeaningfulresultswhen the separationdis-tanceis nearzero. Instead,groupcheckeventsare scheduledata fixed, user-specifiedrate. While collision detectionbetween�and � is beinghandledby a groupcheckevent, theordinary � - �collisiondetectioneventis disabled.

Groupcheckeventsarealsoresponsiblefor detectingfissions.Agraphis constructedin which thegroup’s non-kinematicbodiesareverticesandcontactsareedges.A standardconnectedcomponentalgorithmisperformedonthisgraph.Multiple componentsindicatethat the groupcanbe split. Thereis flexibility in the time to splita group. Integratinga groupwith multiple connectedcomponentsdoesnot give awronganswer;it is simply inefficient sincesmallergroupscanbeintegratedfasterthanasinglecombinedone.

4.5 Collision Checks

At any given point in a simulation,collision checkingis enabledbetweencertainactivepairs of bodies,which arehopefullysmallin numbercomparedto thetotal numberof pairs[21]. Every non-contactingactive pair requiresacollisioncheckevent. Thebodies’statequeuesprovide a simple way to keepthe numberof activepairssmall. An axis-alignedboundingbox is maintainedaroundthesetof statescurrentlycomputedfor eachrigid body(hencetherearemultipleboxesfor multibodiesandgroups).Thissweptvolumegrowsasnew statesarecomputed;it shrinkswhenstatesaredeletedasGVTmovespastthem.Usingsix heapsto maintaintheminimumand maximum � �!" and # coordinatesof the rigid body at eachstate,thesweptvolumeover $ statesis updatedin %'&)(+*-,.$0/ time.

Thepairsof sweptvolumesthat overlapcanbe maintainedus-ing a hierarchicalhashtable [29] or by sortingcoordinatesalongthe threecoordinateaxes[3, 14]. If the sweptvolumesof bodies� and � do not overlap,then � and � areknown to be collisionfreeover theinterval GVT 1 min &2�3 ��4/5� , where min &2�3 6��/ is thetime of � ’s or � ’s lateststate,whichever is earlier. As long asthesweptvolumesremaindisjoint, � and � arenot anactive pair.Now supposeintegrationof � causesits sweptvolumeto overlapthepreviously disjoint sweptvolumeof � . To avoid missingcol-lisions,a new collision checkevent for � and � is scheduledforthetimegivenby thevalueof min &2�3 ��4/ before � wasintegrated(Figure5). The bodiesareknown to be collision free beforethispoint. This new event is in � ’s past,but the timewarp algorithmcanaccommodateit; if a collisiondid occurthenrollbackwill rec-tify the situation. The collision checkevent for � and � remainsactive aslong astheir sweptvolumesoverlap. This methodworkseven thoughthe sweptvolumesexist over differenttime intervalsand may have no statesat commontimes. Inactive pairs do notneedto besynchronizedin orderto remaininactive, which avoidscostlyintegrationinterruptionsfor thevastmajorityof bodypairs.

A

B

A

A

A

B

B

A

B

Figure5: When � is integratedto the stateshown in gray, sweptvolumeoverlapoccurs. � and � becomeanactive pair, anda col-lision checkis scheduledat theearliertimeof thetwo redstates.

Page 6: Timewarp Rigid Body Simulation - Computer Graphics · though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used

simu- # of avg time avg total total complation # of discont- between integr’n # of integr’n rollback time /

duration rigid bodies inuities disconts step integr’ns / moving / moving framesimulation (s) moving/total (thousands) (ms) (ms) (millions) body(s) body(s) (s)atoms 120 302/ 308 51.9 2.31 6.25 6.04 125(+4.2%) 0.278(0.23%) 0.767cars 60 428/ 524 17.8 3.38 14.9 1.98 69.2(+15%) 1.57(2.6%) 0.904robots 120 240/ 430 26.8 4.48 9.88 3.00 124(+3.3%) 1.45(1.2%) 0.707avalanche 45 300/ 824 217 0.208 3.39 5.84 66.0(+47%) 7.15(16%) 97.0

Table1: Datacollectedover thefour simulations.

4.6 Callbac k Functions

It is difficult to completelyhidetheunderlyingtimewarpnatureofthesystemfrom usercallbackfunctions.Becausethebodies’LVTsarenot synchronized,callbackfunctionsinvolving differentbodiesarenot invoked in strict temporalorder. In fact, a callbackfor asinglebodymaynot be invokedat monotonicallyincreasingtimesdue to rollback. Thus, a collision callbackthat countsa body’scollisionsby incrementinga globalcounteris flawedsinceit maygetcalledwith thesamecollision multiple times. Oneconventionthatguaranteescorrectbehavior is to forbidcallbackfunctionsfromaccessingglobaldata.Thefunctionshouldonly usethedatapassedin: the time of the event and the statesof the relevant bodiesatthat time. Data that must persistacrosscallbackinvocationsaresupportedby adjoiningnew slots to the statesof bodies. Unlikeposition andvelocity values,the valuesin theseslots are simplycopiedfrom stateto statesincethereis no needto integratethem,but callbackfunctionscanaccessandmodify thesevalues.Changesareappropriatelyundonewhenthestatequeuesarerolledback.Thecollision counteris implementedcorrectlyby attachingan integerslot to thebodystate.Thecallbackfunctionincrementsthecounter,androllbackmaycausethecounterto decrease.

5 Results

We now describethe resultsof simulatingfour different systemswith a timewarprigid bodysimulator(Figures1 and7). Our imple-mentationdrawsfrom amyriadof componentalgorithmsandtech-niquesdescribedin theliterature;AppendixA describesthemajorones. Robustness—always an issuein rigid body simulation—isparamountfor thekindsof simulationsstudiedhere.Anything thatcan go wrong certainly will when simulatinglarge systemsoverlong times. Our implementationfavors robustnessover efficiency.The issuesarenot theunderlyingcomponentsnor theabsoluteef-ficiency of this particularimplementationbut the degreeto whichtimewarpimprovesany implementation’s performance.

Atoms simulates200 spheresand 100 water-like moleculesbouncingin a dividedbox. During thesimulationthedivider com-pressesonecompartmentandlifts to allow thegassesto mix. Carssimulatesfour multibody vehicleswith active wheelvelocity andsteeringanglecontrollers. Thesedrive over a coursewith speedbumpsandanarrayof 400sphericalpendulums.Robotssimulates20eight-linkmanipulatorsthatrepeatedlypick upboxesandthrowthem. The robotsare fully dynamicobjects,controlledvia jointtorquescommandedby callbackfunctions. Callbacksalsouseaninversekinematicmodel for motion planning. Finally avalanchesimulates300rigid bodiestumblingdown amountainside,creatingavastnumberof interactions.With theexceptionof atoms, all sim-ulationsuserealisticvaluesfor length,mass,timeandearthgravity.Eachwasgeneratedfrom asinglerun.

5.1 Full Timewarp Simulation Data

Table1 shows datacollectedover thecourseof performingthefullsimulations.The percentagesin the total integrationandrollback

columnsarewith respectto thesimulationduration.Computationtimes were measuredon an SGI Onyx (200MHz R10000CPU).Integrationandrollback intervals of multibodiesandgroupswereweightedby the numberof individual rigid bodiesinvolved. Thereasonthattotal integrationminusrollbackexceedsdurationis be-causeof the addedintegration involved in localizing discontinu-ities. Whena discontinuityis detectedover an interval, the sim-ulator mustcomputenew statesof the relevant bodiesin ordertolocalize it. This meansre-integratingover certaintime intervals,increasingthetotal integrationtime.3

Worth noting is the amountby which the averageintegrationstepexceedstheaverageinterval betweendiscontinuities.This ofcourseis a key advantageof the timewarp algorithm: integrationof a bodydoesnot halt at every discontinuitybut only at theoneswhicharerelevantto it. Thefactthattheactualintegrationstepsare2–16timeslargerthantheaverageinterval betweendiscontinuitiesis especiallynoteworthysinceany simulationstrategy (RD, CA, ortimewarp)mustcheck for discontinuitiesatamuchhigherratethanthey actuallyoccur. In our experiments,checksoutnumberedac-tualdiscontinuitiesby two ordersof magnitude.UnderRD or CA,all bodiesarehaltedat every check,althoughthe problemis lesssevereunderRD sincecollision checksaresynchronized.Table1alsoshows thatrollbackis a modestcost.Throughjudiciousundo-ing, timewarpavoids the largeamountof wastedwork inherentinRD asthenumberof bodiesincreases.

In several performancemeasures,the avalanche simulationisan outlier. The slow simulationspeedis not becausetimewarpis not working. The ratio of averageintegration stepto averagetimebetweendiscontinuitiesis quitegood,andthetotal integrationperbody, while high, is not prohibitive. Themaindifficulty is thecomplexity of thecontactgroups:over 16,000groupsareformed,somehaving asmany as64 moving bodiesand217 simultaneouscontacts.Simulatinganavalancheusingparticleor position-basedphysicsmay be morepractical,but the exampleshows that time-warpcanhandleevenextremecaseswell.

5.2 Comparative Simulation Data

Table1 suggeststhetimewarpalgorithmis agoodidea.Furtherex-perimentsgive a morequantitative measureof the improvementitbrings.Weaddedalternatemainloopsto thesimulatorto let it useRD andCA policiesinsteadof timewarp(TW). TheRD algorithmis parameterizedby thebasictimestepto attempton eachiteration;weusedvaluesof 0.001,0.01,and1/30second.All fivealgorithmswererun on a two-secondsegmentof an atomssimulation,withthe divider stationaryin the middle of the box andwith the num-berof bodiesvarying from 25 to 200. Theupperpartof Figure6shows theaverageintegrationsteptakenby thesimulatorunderthevariousalgorithms.Theresultsconfirmthekey problemwith CA:asthenumberof bodiesincreasestheaveragetime to thenext dis-continuity checkdecreases.As Figure 2 shows, the small steps

3Baraff cleverly avoidsthiswasteby usinginternalvaluesof theRunge-Kutta integrator to obtaina polynomialapproximationof thestateover anintegrationstepfor free[5].

Page 7: Timewarp Rigid Body Simulation - Computer Graphics · though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used

0.5

1

5

10

50

100

25 50 75 100 125 150 175 200

mill

isec

onds

7

number of moving bodies

Average Integration Step

TW

RD (0.001)RD (0.01)RD (1/30)

CA

2

5

10

15

20

2530

25 50 75 100 125 150 175 200

seco

nds8

number of moving bodies

Total Length of Integration Intervals Per Body

TW

RD (0.001)RD (0.01)RD (1/30)

CA

Figure6: Integrationstatisticsfor variousatomssimulations.

have adrasticeffecton computationalcost.RD’s averagetimestepis not assensitive to the numberof bodiessinceit alwaystries totake a fixedsizestepforward. TW is alsonot sensitive to it sincethebodiesaredecoupled.The lower portionof thefigureexposesthe problemwith RD: wastedwork. For a two-second,200-bodysimulationanda frameratetimestep,RD integrateseachbodyanaverageof 30 seconds.This is to be comparedwith TW’s valueof 2.3 secondsandthemodestpercentagesin the total integrationcolumnof Table1. CA never integratesmorethantwo secondsperbodysinceit usesaone-sidedapproachto eachdiscontinuity.

Actual executiontimesshedfurther light. For 100 atoms,RD-1/30 is the narrow winner at 0.142s/frame,while TW was0.147s/frameandCA was1.15s/frame. By 200 atoms,TW is clearlysuperiorat0.388s/frame,while RD-0.01, thefastestRD algorithm,was2.61s/frame,andCA was4.74s/frame.

6 Conc lusion

Timewarp rigid body simulationis clearly ableto simulatelargersystemswith moreinteractionsthantraditionalsynchronizedsim-ulationalgorithms.The mostobvious avenuesfor future researchinvolve parallelrigid bodysimulation.Timewarpsimulationhelpspave the way to this goal sincethe individual bodiesareevolvedasynchronously. If the algorithmrunson multiple processors,de-lays dueto communicationlatenciesarehandledin the samewayasbadpredictionsof discontinuitytimes:with minimal rollback.

The simplestway to structurea parallelsimulatorwould be tohaveonemasterprocessorthatrepeatedlysendsintegrationtaskstoa bevy of slave processors.All of theglobaldatastructurescouldbekepton themasterprocessor, requiringlittle changein thealgo-rithmspresentedhere.This couldsignificantlyboostperformanceover theuniprocessorcasebut suffersfrom abottleneckat themas-

ter. An egalitarianapproachin whichbodiesaredistributedamongprocessorsis ultimately morescalable.Importantopenquestionsarehow to parcelthebodiesamongprocessorsandhow to balanceworkloads. At oddsare the goalsof minimizing inter-processorcommunicationby keepingbodiesin the samespatialregion on acommonprocessorandminimizing idle time by shifting bodiestoidleprocessors.At any ratesomemethodandstrategy for migratingthebodiesbetweenprocessorsseemsappropriate.Rollbackproba-bly requiresa full antimessagemechanismsincethestategraphislikely to bedistributed.Otherquestionssurroundhow andwheretostoredatastructureslike thespatialhashtable,which is frequentlyaccessedby all bodies.Eventsinvolving multiple bodiesmight beredundantlystoredandprocessedonmultipleprocessorsor ononlyoneof the relevant processors.Finally, therearevariousprotocolchoicesfor passingstateinformationbetweenprocessors.Clearlytherearemany challengesto building a largesimulationfarm. Yetthe prospectof rich virtual environmentsbuilt on a physics-basedsubstrateis adequatemotivationto pursuethem.

A Implementation Details

Our systemis implementedin C++. All geometriesaremodeledasconvex polyhedraor unionsthereof. The v-clip algorithm[27]is usedfor narrow-phasecollision detection;a hierarchicalspatialhashtable[26, 29] containingaxes-alignedboundingboxesis usedfor thebroadphase.For nearbybodiesnot in contact,timesto im-pactareestimatedfrom currentpositionsandvelocitiesasin [26],but thepredictionsarenot conservative. Persistentcontactis mod-eled using a penaltyforce method;spring and damperconstantsarespecifiedper bodypair. Inspiredby [1] we usean implicit in-tegrator (4th orderRosenbrock[30]) with a sparsesolver [15] tohandlestiffnessinducedby thepenaltymethod.This is only nec-essaryfor contactgroups;isolatedbodiesareintegratedwith a 5thorderRunge-Kuttaintegrator[30]. Weuseasmoothnonlinearfric-tion law, 9;:�<�9;=?>A@�B-CED0&)F-:�<;G-/ [34]; staticfriction is not modeled.Reducedcoordinatesareusedfor multibodies,with dynamicscom-putedby a generalizedFeatherstonealgorithm[16] in the isolatedcaseandby thespatialcomposite-rigid-bodyalgorithm[24] withincontactgroups.Thelatter is moresuitedto generatingtheacceler-ationJacobianrequiredby theimplicit integrator.

References[1] D. Baraff andA. Witkin. LargeStepsin ClothSimulation.In MichaelCohen,ed-

itor, SIGGRAPH98 ConferenceProceedings, AnnualConferenceSeries,pages43–54.ACM SIGGRAPH,AddisonWesley, July1998.

[2] David Baraff. CurvedSurfacesandCoherencefor Non-PenetratingRigid BodySimulation. In ComputerGraphics(SIGGRAPH90 ConferenceProceedings),volume24,pages19–28.August1990.

[3] David Baraff. DynamicSimulationof Non-Penetrating Rigid Bodies. Ph.D.thesis,Departmentof ComputerScience,CornellUniversity, March1992.

[4] David Baraff. FastContactForceComputationfor NonpenetratingRigidBodies.In SIGGRAPH94 ConferenceProceedings, Annual ConferenceSeries,pages23–34.ACM SIGGRAPH,AddisonWesley, 1994.

[5] David Baraff. Interactive Simulationof Solid Rigid Bodies. IEEE ComputerGraphicsandApplications, 15(3):63–75,May 1995.

[6] RonenBarzelandAlan H. Barr. A ModelingSystemBasedon DynamicCon-straints. In ComputerGraphics(SIGGRAPH88 ConferenceProceedings), vol-ume22,pages179–188.August1988.

[7] J. Basch,L.J. Guibas,andJ. Hershberger. DataStructuresfor Mobile Data. InProceedingsof 8thSymposiumon DiscreteAlgorithms. 1997.To appearin J.ofAlgorithms.

[8] RaymondM. Brach.MechanicalImpactDynamics;RigidBodyCollisions. JohnWiley & Sons,Inc., 1991.

[9] David C. Brogan,RonaldA. Metoyer, andJessicaK. Hodgins. DynamicallySimulatedCharactersin Virtual Environments. IEEE ComputerGraphicsandApplications, 18(5):58–69,September1998.

[10] StephenCameron.EnhancingGJK:ComputingMinimum PenetrationDistancesbetweenConvex Polyhedra. In Proceedingsof International ConferenceonRoboticsandAutomation. IEEE,April 1997.

[11] DeborahA. CarlsonandJessicaK. Hodgins. SimulationLevels of Detail forReal-timeAnimation. In Proc.of GraphicsInterface’97, pages1–8.1997.

Page 8: Timewarp Rigid Body Simulation - Computer Graphics · though a continuous process, exhibits many aspects of a discrete one. With modification, the timewarp algorithm can be used

Figure7: Left to Right: snapshotsfrom theatoms, cars androbotssimulations(thanksto Larry Gritz for BlueMoonRenderingTools).

[12] Anindya ChatterjeeandAndy Ruina. A New AlgebraicRigid Body CollisionLaw Basedon ImpulseSpaceConsiderations.Journal of AppliedMechanics,65:939–951,December1998.

[13] StephenChenney, Jeffrey Ichnowski, and David Forsyth. DynamicsModel-ing and Culling. IEEE ComputerGraphics and Applications, 19(2):79–87,March/April 1999.

[14] JonathanD. Cohen,Ming C. Lin, DineshManocha,andMadhav K. Ponamgi.I-COLLIDE: An Interactive and Exact Collision DetectionSystemfor Large-ScaledEnvironments. In Symposiumon Interactive3D Graphics, pages189–196.ACM SIGGRAPH,April 1995.

[15] J. Dongarra,A. Lumsdaine,R. Pozo, and K. Remington. A SparseMa-trix Library in C++ for High PerformanceArchitectures. In Proceedingsof the SecondObject Oriented NumericsConference, pages214–218.1992.www.math.nist.gov/iml++.

[16] R. Featherstone.The Calculationof RobotDynamicsUsing Articulated-BodyInertias.InternationalJournalof RoboticsResearch, 2(1):13–30,1983.

[17] S.Gottschalk,M. C. Lin, andD. Manocha.OBB-Tree:A HierarchicalStructurefor Rapid InterferenceDetection. In Holly Rushmeier, editor, SIGGRAPH96ConferenceProceedings, AnnualConferenceSeries.ACM SIGGRAPH,Addi-sonWesley, August1996.

[18] Brian Von Herzen,Alan H. Barr, andHaroldR. Zatz. GeometricCollisionsforTime-DependentParametricSurfaces. In ComputerGraphics(SIGGRAPH90ConferenceProceedings), pages39–48.1990.

[19] JessicaK. HodginsandNancy S. Pollard. AdaptingSimulatedBehaviors forNew Characters.In TurnerWhitted,editor, SIGGRAPH97ConferenceProceed-ings, Annual ConferenceSeries,pages153–162.ACM SIGGRAPH,AddisonWesley, August1997.

[20] JessicaK. Hodgins,WayneL. Wooten,David C. Brogan,andJamesF. O’Brien.Animating HumanAthletics. In SIGGRAPH95 ConferenceProceedings, An-nualConferenceSeries,pages71–78.ACM SIGGRAPH,AddisonWesley, 1956.

[21] Philip M. Hubbard. ApproximatingPolyhedrawith Spheresfor Time-CriticalCollisionDetection.ACM Transactionson Graphics, 15(3),July1996.

[22] David R. Jefferson. Virtual Time. ACM Transactionson ProgrammingLan-guagesandSystems, 7(3):404–425,July1985.

[23] V. V. Kamat.A Survey of Techniquesfor simulationof DynamicDynamicCol-lision Detectionand Response.ComputerGraphicsin India, 17(4):379–385,1993.

[24] KathrynW. Lilly . EfficientDynamicSimulationof RoboticMechanisms. KluwerAcademicPublishers,Norwell, 1993.

[25] Victor J. Milenkovic. Position-BasedPhysics:SimulatingtheMotion of ManyHighly InteractingSpheresand Polyhedra. In Holly Rushmeier, editor, SIG-GRAPH96ConferenceProceedings, AnnualConferenceSeries,pages129–136.ACM SIGGRAPH,AddisonWesley, August1996.

[26] BrianMirtich. Impulse-basedDynamicSimulationof RigidBodySystems. Ph.D.thesis,Universityof California,Berkeley, December1996.

[27] Brian Mirtich. V-Clip: FastandRobust PolyhedralCollision Detection. ACMTransactionson Graphics, 17(3):177–208,July 1998. Mitsubishi Electric Re-searchLabTechnicalReportTR97–05.

[28] J.ThomasNgoandJoeMarks.SpacetimeConstraintsRevisited.In SIGGRAPH93 ConferenceProceedings, Annual ConferenceSeries,pages343–350.ACMSIGGRAPH,AddisonWesley, 1993.

[29] M. Overmars.PointLocationin Fat Subdivisions. InformationProcessingLet-ters, 44:261–265,1992.

[30] William H. Press,SaulA. Teukolsky, William T. Vetterling,andBrian R. Flan-nery. NumericalRecipesin C: The Art of ScientificComputing. CambridgeUniversityPress,Cambridge,secondedition,1992.

[31] EdwardJ.Routh.ElementaryRigidDynamics. Macmillan,London,1905.[32] Karl Sims. Evolving Virtual Creatures.In SIGGRAPH94 ConferenceProceed-

ings, AnnualConferenceSeries,pages15–22.ACM SIGGRAPH,1994.[33] JohnM. Snyder, AdamR. Woodbury, Kurt Fleischer, BenaCurrin,andAlan H.

Barr. Interval Methodsfor Multi-Point Collisions betweenTime-DependentCurved Surfaces. In SIGGRAPH93 ConferenceProceedings, Annual Confer-enceSeries,pages321–333.ACM SIGGRAPH,AddisonWesley, 1993.

[34] PengSong,PeterR. Kraus,Vijay Kumar, andPierreDupont. Analysisof RigidBodyDynamicModelsfor Simulationof Systemswith FrictionalContacts,June1999.Submittedto ASME Journalof AppliedMechanics.

[35] D.E. Stewart and J.C. Trinkle. An Implicit Time-SteppingSchemefor RigidBody Dynamicswith InelasticCollisionsandCoulombFriction. InternationalJournalof NumericalMethodsin Engineering, 39:2673–2691,1996.

[36] J.C.Trinkle, J.S.Pang,S.Sudarsky, andG. Lo. On DynamicMulti-Rigid-BodyContactProblemswith CoulombFriction. Zeitschrift fur AngewandteMathe-matikundMechanik, 77(4):267–279,1997.

[37] Andrew Witkin, Michael Gleicher, andWilliam Welch. Interactive Dynamics.ComputerGraphics, 24(2):11–22,March1990.