I'm attempting to a add dragon, a floating sorceress plus a few nasty birds.
What's the best way to go about this problem?
I'm currently thinking of using a character controller and applying upward impulses.
Flying Character Simulation
Flying Character Simulation
BEPUphysics rules my world
http://cloneofduty.com
http://cloneofduty.com
Re: Flying Character Simulation
CharacterControllers aren't particularly valuable for things which don't walk around on the ground. Creating an entity, setting its IsAffectedByGravity to false, and then controlling its LinearVelocity and AngularVelocity directly (which is equivalent to applying impulses) would probably the simplest and best option. Of course, you could keep the entity affected by gravity and apply upward impulses too depending on what kind of behavior you want.
Re: Flying Character Simulation
The simpler approach seems sensible.
I've looked through some similar posts: one about a jetpack and another about swimming. From those I worked out I need to do something like this:
I will change it from using a character to just a box as you've suggested as I can't envisage a situation when they will be touching the ground.
However I have another related question. I wanted the Witch to float quite close to the ground. Can I surround her with an additional larger box that I can use for collision testing, rather than casting rays.
In another post you helped me create collision groups, so objects would only interact with static terrain. I need something similar. I would like to see if the larger collision box is colliding but I don't want it to push or hinder any other objects.
Thanks!
I've looked through some similar posts: one about a jetpack and another about swimming. From those I worked out I need to do something like this:
Code: Select all
character.CharacterController.Body.ApplyImpulse(
character.CharacterController.Body.Position,
Vector3.Up *
sm.Space.ForceUpdater.Gravity *
character.CharacterController.Body.Mass *
dt);
However I have another related question. I wanted the Witch to float quite close to the ground. Can I surround her with an additional larger box that I can use for collision testing, rather than casting rays.
In another post you helped me create collision groups, so objects would only interact with static terrain. I need something similar. I would like to see if the larger collision box is colliding but I don't want it to push or hinder any other objects.
Thanks!
BEPUphysics rules my world
http://cloneofduty.com
http://cloneofduty.com
Re: Flying Character Simulation
That would almost work- however, in the direction part:I've looked through some similar posts: one about a jetpack and another about swimming. From those I worked out I need to do something like this:
Code: Select all
Vector3.Up *
sm.Space.ForceUpdater.Gravity *
character.CharacterController.Body.Mass *
dt
Code: Select all
-sm.Space.ForceUpdater.Gravity *
character.CharacterController.Body.Mass *
dt
Code: Select all
character.CharacterController.Body.LinearVelocity -= sm.Space.ForceUpdater.Gravity * dt;
Using a CollisionRule of NoSolver would do the trick. Contacts are still generated, but no collision response occurs.However I have another related question. I wanted the Witch to float quite close to the ground. Can I surround her with an additional larger box that I can use for collision testing, rather than casting rays.
In another post you helped me create collision groups, so objects would only interact with static terrain. I need something similar. I would like to see if the larger collision box is colliding but I don't want it to push or hinder any other objects.
Re: Flying Character Simulation
Perfect!
Thank you.
Thank you.
BEPUphysics rules my world
http://cloneofduty.com
http://cloneofduty.com