Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cmake + Physics Lecture 2.

Similar presentations


Presentation on theme: "Cmake + Physics Lecture 2."— Presentation transcript:

1 cmake + Physics Lecture 2

2 “Normal” makefiles In (nearly) all OS’s there’s a tool called make
Essentially a project file Command-line arguments to the compiler / linker Rules to rebuild a particular file Dependencies (e.g. file a references file b, so file b must be built first) Configurations (debug, release, etc.) Cross-platform… …if the compiler is built for your OS’s Windows doesn’t have this. Cmake is a tool that sort of does the above, then some. Takes a cross-platform script (CMakeList.txt) Allow the user to modify exposed parameters Build a project file for your compiler of choice Seems to be the most popular tool for this right now.

3 using cmake Get it (https://cmake.org/)
Get your source code repo (Bullet for us) Open the top-level folder that contains CMakeList.txt (e.g. c:\myrepo) Suggested: Make the output folder in a build sub-folder (e.g. c:\myrepo\build) This is where all settings are stored. Click Configure, select your compiler (VS2015 for us) Make any parameter changes if needed, the click Configure again Click Generate Caution: once you click this, the project seems to be “fixed” If you need to make changes, I keep CMake open and delete the build sub-folder Now open the build folder, open the project file and (Batch) build it!

4 intro to bullet References: Some highlights
Some highlights Erwin Coumans (Sony Entertainment, AMD, Google) main developer Open-source (zlib) Modular (pick and choose the features you want to use) Rigid and Soft body dynamics Discreet and Swept collision detection Used in many games (GTA V, Red Dead Redemption, Rocket League, …) …and movies (Shrek 4, Sherlock Holmes, …) …and modeling software (Blender, Houdini [Pixar], …)

5 Side-note on frame rates
In Jason’s opinion, variable frame rate should be used in all cases BUT: image-based animation (e.g. Street Fighter 2) physics! Workarounds Fix our internal update rate Threading (and critical section / mutexes / etc.) Bullet will internally use a 60Hz update, but does interpolation

6 Intro to bullet I used the “Hello World” sample in my solution:
.cpp (For now) we’ll keep the same setup for the physics manager For Physics-enabled objects I want two modes: “Bullet in control” (when bullet is updated, make the Ogre object reflect pos / rot changes) “Ogre in control” [later] (when Ogre updates this object, make Bullet reflect that) For player-controlled objects For movement-scripted objects (e.g. a guard walking on a set path) Bullet (as Unity) breaks physics into 2 parts: A Collider (box, sphere, capsule, etc.) A rigid body (mass, moment of inertia, etc.) In bullet, a mass of 0.0 means the object is static (can move other things, but isn’t moved itself)

7 Bullet “guts” I could list them all here…
…I’ll think it would be more effective for you to research. Use the first link on slide 4 – that’s the best reference I can give. If you want more detail, check out the manual (the 2nd link on that slide) Ask questions – I’ll give you good hints, but I need you to ask…


Download ppt "Cmake + Physics Lecture 2."

Similar presentations


Ads by Google