May 22, 2012, 05:06:27 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 2 [3]
  Print  
Author Topic: Controlling Sub Meshes  (Read 2410 times)
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #30 on: September 13, 2008, 07:54:16 PM »

Yeah, "things we lost in the fire" Smiley We want to get things back from before. Even if some scripts can't be applied the knowledge is really good
Logged
Ransom
Full Member
***
Posts: 132



View Profile
« Reply #31 on: September 14, 2008, 10:47:01 AM »

Quote
Also, Is there no way to get your vehicle riders to take personal damage? What about if he's riding a motorcycle and you shoot him in the back? Could you enable or disable a basic player collision mesh into the vehicle that's coded to transfer the damage instead of blow up the vehicle? Like, when the bike is stationary, the dummy collision is inactive and when you get in it appears around your character...like a simple box or something? I was thinking I could get a simple box on the blades aswell...of course I woudn't be able to move around at all then, would I?

Collision and taking damage don't have to go hand in hand.  Ray casting can be used to "hit" an object without concern for whether the object has collision.  Ray Casting also returns the vector at which the ray and the object hit intersect, so you could definitely use that info to determine whether the bike or the player were hit.  The same info could be used for a million other things as well, head shots vs. body shots, hitting buttons on a key pad, placing fx, just to name a few.
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #32 on: September 16, 2008, 08:07:58 PM »

I have another question about .FBX submeshes: I'm noticing that the LOD distance is based upon the pivot location of the total .FBX object rather than the pivot location of the submesh itself. In realizing that, we can't put together too large of an object, like a whole sewer or cave system. Is there anyway to correct that? In all honesty, I'd like to be free to build even my entire map as one .FBX system. I doubt I'll go quite that far with it, but there is justification for allowing the freedom.

Namely, my project is hinging around a single main mesh, the house. Since it's constantly #1 on the render time and texture memory profiler, I'm going to partition that sucker into a bunch of quadrants...mainly by room and then try out the newer occlusion tools when I get them.

My hopes were to export all the separated rooms as part of one .FBX, so that I don't get annhilated with hassles when putting it in the engine. But if all those pieces don't occlude or go to LOD's except by that one pivot point way down in the bottom of my basement, then I might aswell just keep it one piece and let it lag.

I even have a .BSP ready version of the exact same house where I spent like 13 hours one day splitting it into convex volumes. About 385 of 'em and not a seam in sight. If I run LOD's on something like that, I could potentially get a decent framerate buffer for my other stuff. However, I only did that cause I was destined for torq...sorry, destruction. I hate that format and that restriction, but I see it's place. I could easily split it by room and only have interior facing polys per occlusion area. But this really will be a nightmare if it has be all separated to work.

Am I also correct in assuming that the individual submeshes don't have their bounding boxes calculated? Occlusion is by bounding box, correct?
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #33 on: September 26, 2008, 10:02:15 PM »

Just wanted to update that I did get the door working with the collisions updating properly. I'll post my script but there's other door scripts out there that might be better for what you want.

I split the door from the frame and rotated the entire object and it works fine. Right now it opens when you walk into a box and closes slower when you leave the box. It can be set to work any way, such as read your distance and open more as you approach or stay open or whatever. The frame is just another object put there, I wont' post the .OPR for it cause it's nothing to do with it.

Door_Solo.OPR
Quote
OPRP

LoadObject Door_Solo.FBX

EditObject Hinge
ObjectName Hinge
ObjectMaxDepth 40

EditObject Door
ObjectName Door
ObjectParent Hinge
ObjectMaxDepth 200

EditObject Fittings
ObjectName Fittings
ObjectParent Door
ObjectMaxDepth 20

EditObject Knobs
ObjectName Knobs
ObjectParent Fittings
ObjectMaxDepth 80

EditObject Latch
ObjectName Latch
ObjectParent Fittings
ObjectMaxDepth 20

AddCollision Box
CollisionType Box
CollisionBoxSize 16.5 44.5 1.6
CollisionCenter -8.2 22.53 1.25
CollisionTransformIndependently 0
CollisionMass 0
CollisionMassOffset 0.000000 0.000000 0.000000
CollisionFriction 0.1
CollisionBouncyness 0
CollisionBounceVelocity 0.1
CollisionGravityEnabled 0

Keep in mind all parameters are to my object's scale.

Door.gsl
Quote
float spin = 0;
float maxopen = -85;
Vector vspin;
bool open = false;
Matrix startingMatrix;
int x;
String VictoryController = "cheesebit_global";


void Initialize( Object@ object)
{
   Object@ door = GetGameManager().GetWorld().GetObject("Door_Solo");
   startingMatrix = door.GetCurMatrix();
   vspin.z = 0;
   vspin.y = 0;
   vspin.x = 0;
   //~ Vector rotation = object.GetMesh("Hinge").GetRotationEuler();
   //~ object.UpdateCollisionObjectPositions();
   //~ print(rotation);
}


bool HandleEvent( Object@ object, const String& in event, GameEventParams@ params)
{
   Object@ victoryobject = GetGameManager().GetWorld().GetObject("cheesebit_global"); //get handle to victory state
   

   bool victory = victoryobject.GetControllerSettingBool("WON");
   
   if(victory == true)
   {
      if(event == "EnterProximity")
         {
            print("IN");



         }
         
      if(event == "Input")
         {
            open = true;
            
         }
         else
         {
            open = false;
            
         }
         
      
         return true;
   }
   else
   {
   GetGameManager().ShowTextPlain("YOU HAVEN'T CLEARED THE ROOM!", 2);
   return false;
   }
}


void DynamicsAdvance( Object@ object, float seconds)
{
Object@ door = GetGameManager().GetWorld().GetObject("Door_Solo");
door.GetCurMatrix() = startingMatrix;
door.GetCurMatrix().Rotate( vspin);
door.UpdateCollisionObjectPositions();
   
      if(open == true)
      {
         if(vspin.x<=maxopen)
         {
            vspin.x = maxopen;
         }
         else
         {
            vspin.x -= 0.5;
         }
      }
      else
      {
         if(vspin.x>= 0)
         {
            vspin.x=0;
         }
         else
         {   
         vspin.x += 0.1;
         }
      }
}

I also did a fan with basic rotation.
Ceiling_Fan.OPR
Quote
OPRP

LoadObject CeilingFan_Blades.FBX

ControllerType Scripted
ControllerSetting ScriptFile FanSpin.gsl
ControllerInputCenter -10 2.5 0
ControllerInputBoxSize 3 5 10

AddCollision Collision
CollisionType UseRenderObject
CollisionFriction 999999
CollisionBouncyness 0
CollisionBounceVelocity 0.1
CollisionGravityEnabled 1

FanSpin.gsl
Quote
Vector vspin;
Matrix startingMatrix;
//
void Initialize( Object@ object)
{
vspin.y=0;
   vspin.z=0;
   startingMatrix = object.GetCurMatrix();
}

//
bool HandleEvent( Object@ object, const String& in event, GameEventParams@ params)
{
return true;
}

//
void DynamicsAdvance( Object@ object, float seconds)
{
object.GetCurMatrix() = startingMatrix;
   object.GetCurMatrix().Rotate( vspin);
   object.UpdateCollisionObjectPositions();
   vspin.x += 0.1;
      
}

When standing on the blades (mine are giant) you have to walk to stay on it, you don't stick or spin with it. I haven't tackled this yet.

Also: That's only one way to spin the object, and it's actually more suited for a situation where you'd want to be able to only rotate the blades to a particular angle and stop or go the other way (more for a door). If you just want a simple spin on your object, the following script will suffice. It's gonna spin really fast at 10 degrees away from its current rotation, calculated per tick.

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

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

      
}
« Last Edit: September 26, 2008, 10:11:12 PM by Squat » Logged
Pages: 1 2 [3]
  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!