-
Posts
2,412 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Posts posted by SpiderPig
-
-
You could;
Create pivot.
Parent pivot to the foot bone.
Create Box shape for the pivot.
Enable collisions between the box and pivot as Trigger.
In the scripts Collision() function -> Get the box entity and AddPointForce() at the collision position.
- 1
-
What I have at the moment is the terrain triangles surrounding the player are created from a polymesh (in red). If I set the collision between the terrain shape and the player shape to collide it calls the Collison() callback, but if I set it too trigger it falls straight through without triggering it. The box (in green) is also a trigger an it works flawlessly.
Does a trigger shape need to be a volume rather than a group of thin polys?
A bit of info on what I'm doing;
I am applying a force to the player's shape to simulate gravity, when a collision on the terrain is detected it stops the velocity and keeps the entity at that position until moved by the player. To find the position the player should move too, I get the collision normal, create a plane, and find a position on that plane a little further forward (or backward) then use PhysicSetPosition() to move it there. The problem with the collision set to collide is the player drags across the surface and causes jittering. I need to be able to detect the collision without the physics system actually doing anything. I.e. A trigger.
-
Okay thanks, I'll see how it goes. If it doesn't work well I'll try making a predefined list of rotations for each of the gravity directions.
-
Thanks. So those problems wouldn't exist with AlignToVector() or Point()? ?
-
How would I transform the following (or any other) vector to a 3D rotation without using a pivot as a buffer? Can the Transform functions be used here or have I already found the easiest way? Calling on any math guys out there...
upDirection = Vec3(0.0f, 1.0f, 0.0f); pivotAlignment->AlignToVector(upDirection, 1); Vec3 _rot = pivotAlignment->GetRotation(); //_rot = Vec3(0.0f, 0.0f, 0.0f); physicsParent->PhysicsSetRotation(_rot, 1.0f);
I don't want to use a pivot because, well, it just seems ugly.
-
I solved the jittering of the physics object, it was simple. I was setting the cameras pivot to the heads position each frame instead of parenting it to the head bone (doing that caused the camera to rotate with the bone - which was kinda what I wanted except the bone had weird rotations on top of how it was animated)
auto _headPos = frameManager->GetBonePosition(bones.head, true); cameraPivot->SetPosition(_headPos, true);
So I just parented the camera's pivot the player entity instead. Problem-o solved.
- 1
-
I'll reduce the poly count and see how that helps then.
QuoteThe number of batches is probably the bottleneck here.
Is a batch a group of entities that fall within the frustum?
QuoteNew engine is very very good at handling those.
You tease me - I'm thinking about moving over to Turbo now but am worried there might not be enough features yet to make the transition seamless. Like I know there is no 2D drawing yet... and some commands are missing...
-
After a bit of testing I think the low FPS is due to multiple things. 1 to 2 million triangles and up to 300 - 400 batches. There is also an algorithm that runs every so often and can eat up to 10ms which drops the frame rate quickly (I think this sudden drop is causing the jerking movements). The physics shape I'm using is 360 polys - too much?
#canwaitforturbo
-
Ah I see, so the class needs to be derived from Object and SetObejct() is for setting and object in a script. Thanks for the help!
-
I've tried entity->GetObject() and that returns NULL also. What else is there to try? Do I need to disable something somewhere in the windows macro?
-
I thought about that, but it would involve a major rework, if these functions do what I think they're supposed it would be easier.
-
Not sure if I'm using these right - is GetObjectA() the correct one to use?
auto _interaction = new Interaction(); entity->SetObject("interaction", (Object*)_interaction); auto test = entity->GetObjectA("interaction");//retuns NULL
I've been using SetUserData() previously but I need more than one object assigned to an entity.
-
Is there a minimum FPS a game should run at to have smooth physics? Mine is hitting 40 to 50 FPS at the moment and physics is very jumpy. It is even worse in debug mode when fps gets as low as 10. It's not just lag between frames - physics actually goes haywire. I'm wondering if it is a result of low FPS or somthing else in my code.
-
Kinematic::Break()
The above seems to disable a Kinematic joint, is there a function to enable it again?
-
I get the error for all 12 on the first page logged in and 4 out of 12 logged out.
-
@Josh is this a bug?
-
I can't access individual games whilst logged in and only a few are not available whilst signed out. Any one else having issues there?
QuoteSorry, there is a problem
Something went wrong. Please try again.Error code: EX0
-
I think I got it working, just call camera->Render() with a buffer enabled. Thanks for your help.
- 1
-
Thanks, I'll give that a go. Does the second camera get rendered automatically in World->Render()?
-
Okay thanks. Do you think this would be possible if I render too a second camera instead? Or maybe render the object on top of the context somehow... ?
-
auto _currentWorld = World::GetCurrent(); world = World::Create(); auto b = Model::Box(); b->SetColor(1, 0, 0, 1); World::SetCurrent(_currentWorld); worldBuffer = Buffer::Create(512, 512);
I'm trying to create a second world where I can render an object in and then draw that render on screen. But so far I can't get the second world to show anything, can anyone see anything wrong with my code?
Texture* cInventory::_renderWorldBuffer() { auto _currentBuffer = Buffer::GetCurrent(); worldBuffer->Enable(); //World::GetCurrent()->Render(); <- This works world->Render(); //This is not _currentBuffer->Enable(); return worldBuffer->GetColorTexture(); }
-
Thanks for that.
-
Very interesting.
- 1
-
I forget, was there a way to animate the top half of a character differently to the bottom half? Like, legs walking and arms holding a weapon?
Kicking Boxes
in Programming
Posted
I take it your character is animated? If so the foot bone will be a child of your player entity.
Entity::FindChild("nameofbone");