Showing posts with label physics. Show all posts
Showing posts with label physics. Show all posts

Thursday, 27 May 2010

Video: Reflection & Refraction + FluidVolumes

I just finished a short sample video that demonstrates another combination of Sunburn + BEPU. The video contains both the Reflection/Refraction sample from Sunburn and the FluidVolume feature that's part of BEPUphysics.

(Sorry for the first glitched second of the video, it happend when Youtube converted the video)

On a side note, we've made some amazing progress with our upcoming game "Over Night" all footage/development videos will be released in about 2 weeks. We have been invited by Microsoft (NL) to pitch a demo once we have finished our prototype! We're very excited about that of course :)

Sunday, 16 May 2010

BEPU with Sunburn integration Source Available!

The sample project is finished! :) The source download link is available below.

A quick rundown of todays progress. Multi-threading got added (very easy thanks to BEPU) Cleaned up the code to hopefully help you quickly understand one of the possible ways to fix and maintain a relationship between your physics & your visuals. Spacebar will spawn a lot of spheres into the scene and left/right button will shoot sphere(s) from your current location. Leave your Feedback, Questions or just your thoughts in the comments section below ;)

Image:


What's inside?

* One of the possible ways to combine your physics with your visuals.
* Commented lines explaining the code required to setup BEPU in your Sunburn project
* A basic scene (default start kit from Sunburn) with some additional dynamic objects
* Multi-threaded physics
* A ragdoll
* DebugDrawer to visualize boundingboxes
* Actor class that combines Entity & SceneObject

The "Blades" mesh isn't using his own dynamic collision yet. May be something for a future release ;)

Don't hesitate to report any bugs or other suggestions...

Source link HERE. Enjoy!

(Sunburn is required to run the sample) More info on BEPUphysics here.

Saturday, 15 May 2010

Sunburn with BEPU physics: Day 1.

I've started working on a sample combining BEPU physics with the visuals of Sunburn. Almost everything is working so far, the code will need some minor cleanups before I'll release it. The purpose of this sample is demonstrating one of the possible techniques you can use to combine the physics with the visuals. The source is not yet available. I hope to have it ready & uploaded before the end of the weekend.

For now here are some images & a video :)



The video is using the default Sunburn sample LightRig.

Saturday, 20 February 2010

Engine Update: Multi-threading & BEPU

Integrated BEPU's method for easy physics Multi-Threading. The Physics class has the following code for Multi-Threading the physics.

if (Environment.ProcessorCount > 1)

{

for (int i = 0; i < Environment.ProcessorCount; i++)

{

Space.threadManager.add();

}

Space.useMultithreadedUpdate = true;

}



What this does is run through all the processors available on your machine and add it to the thread-manager to spread load across all available CPUs. Thanks to BEPU the integration is VERY easy. A pdf + sample is available on their site.

Multi-threading on the Xbox is slightly different, however it shouldn't be a problem considering the available documentation and sample by BEPU.

I still had some time left to test the performance gains using a small demo scene I made yesterday. It's basically a dominos scene with 350+ domino bricks in 3 lines getting knocked over by three boxes slinging through the air. With the debugger still attached the performance drops to 2 FPS at its lowest. Activating Multi-threading on two cores (my laptop has a Core2Duo (T9400) CPU, without Hyper-Threading) the lowest FPS recorded is 31. That is an amazing difference in performance. Another test without the debugger attached didn't get the demo-scene below 60.

Another thing I worked on today are trigger-volumes. These can be used for a number of tasks (audio triggers, portals, level events etc.) BEPU has a very nice EventManager attached to every Entity. With this manager you can easily add events to your game objects. There is not much to see so far, but I hope to have some cool demo scene ready very soon...I'd like to get rid of the boring cubes and show some actual cool stuff :)

Entity.eventManager.addEventHook(new EventHandlerInitialCollisionDetected(initialCollision));

This will fire the attached method only once when the Entity is colliding with another Entity...The fired method could be something like this:

public void initialCollision(Entity sender, Entity other, CollisionPair pair)

{

other.moveTo(new Vector3(0, 10, 0));

}

This will move the colliding Entity to the Vector3 position...More on this in a later video ;)

Image of the current demo scene:

Sunday, 31 January 2010

Engine Update and the future...

Yesterday I did some work on the engine and added some functionality.

The first one is 'BlockingVolumes' it's now possible to add blocking volumes to the scene, this can be used to efficiently create collisions for high poly scenery where trianglemesh collision might wreck the performance.

Finally added the character controller from BEPU Physics library. Out of the box it can: Walk, turn (look), jump, step (onto stairs and other objects) much like you would expect :P Luckily a camera toggle type was already implemented, so it's now possible to toggle between play mode (= camera fixed to player view) and edit mode (camera in free roam) very easily.

I did some work with custom Sunburn Lights. First off, a candle light. So far it's a fairly basis class that will simulate a lit candle. I hope to include this in a video tomorrow.

On Tuesday, my school will kick-off a new project. We might be required to use Unity instead of XNA. This would pretty much ruin a lot of my plans (to use this engine for my school projects) While Unity is really not a bad tool, I do prefer to stay with XNA. If I do not get permission to use XNA, that does not mean the end of the engine development. However, I will have to cut down on the time I can spend developing it. I just hope they will allows use to keep using XNA (That's what they've been teaching us the last couple of months anyway) If they don't, I'll have to rethink my plans.

On a brighter note, there are some cool ideas to be announced in the near future... It involves Synapse Gaming (creators of Sunburn) and should really help XNA developers with their awesome ideas. I'm not sure how much I can say about it, as it's still only a concept. Hopefully I can give you more information, soon ;)

Sunday, 24 January 2010

Editor Update: Physics Rotation

Just a quick video update. Implemented rotation of Dynamic and Static actors in editmode. For now, rotation is done using the Arrow-keys. This will soon be changed (most likely using a rotation gizmo)

Tuesday, 12 January 2010

First BEPU Integration Steps...

Just a small update this time...

Added some BEPU (Physics) functionality. 'StaticMeshActor' used as the static ground mesh in the video. 'DynamicMeshActor' the movable boxes. And of course the vehicle that can be driven around. Currently BEPU is not a priority milestone for the engine, messing around with physics is always fun however :)

The vehicle is a great starting point to demonstrate XML tweaking in a live scenario. All I have to do is convert all hardcoded values (like grip, torque etc.) into variables and add some XML functionality to the VehicleActor class. I hope to have a video about it by the end of the week. For now, I'll leave you with this: