May 23, 2012, 01:43:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: I need help with collisions on a windmill  (Read 456 times)
SlashDot
Newbie
*
Posts: 7


View Profile
« on: June 23, 2009, 01:41:25 PM »

I got this windmill in a marble game I'm making. I want the marble to be hit by the windmill blades to be sent off course. In my collision I don't know what collision type or what options I should change to make this a working wind mill, also every time i click follow object animation and save, then exit the editor it is unchecked when return. and suggestions?
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #1 on: June 23, 2009, 03:17:13 PM »

I wouldn't hand animate the windmill spinning.

Detach the entire spinning part of the mill to a completely separate object and export it separate from the base.

Add collision boxes to it.

Create a new script and paste in the following code:

Quote
void DynamicsAdvance( Object@ object, float seconds)
{

   object.GetCurMatrix().Rotate( 0.1,0,0);
   object.UpdateCollisionObjectPositions();

      
}

Adjust speed and axis to your object.

Reference this script on the spinning blades in the controller options.

Enjoy?
Logged
SlashDot
Newbie
*
Posts: 7


View Profile
« Reply #2 on: June 23, 2009, 05:34:45 PM »

What exactly do you mean by "Add collision boxes to it?" Not to be a complete noob, but could ya walk me through step by step? Cheesy
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #3 on: June 23, 2009, 06:14:10 PM »

Well, you'll need collisions on the blades. The usual practice is to replace the visible mesh with cubes. This is done in the physics editor and is a bit of a pain, but quite easy to do. Just click "Add Collision" and then set the type to box, then set the size and position.

You just can't rotate collision meshes, so if you have more than 4 blades, you're going to need to add external meshes.

You "could" use the render mesh, but don't expect great results. You should at the least create a very low-resolution collision object for the fan blades in your modeling app and use that instead of the render mesh.

In the end, the point is that you're going to set the collision up as if this was a static object that didn't move. HOWEVER you would go about doing that, do it. Then you get it moving and that code will update the collision to rotate with the object.
Logged
gekido
Guest
« Reply #4 on: June 26, 2009, 12:44:43 PM »

You can't rotate collision meshes, but you can attach them to meshes in your model - so if each blade is a seperate sub-mesh in the model, you can specify 'attach to object' and point the collision mesh at the blade.   you may need to specify that they are independent (checkbox on collision edit panel) as well.
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!