Search found 99 matches

by tomweiland
Sun Jun 23, 2019 11:29 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

So I switched the PointOnLineServo out for a LinearAxisMotor: motor = new LinearAxisMotor() { LocalOffsetA = new Vector3(0, 0, 0), LocalOffsetB = new Vector3(0, 0, -1), LocalAxis = new Vector3(0, 1, 0), TargetVelocity = 5, Settings = new MotorSettings(100, 1) }; The rest of the setup remains the sam...
by tomweiland
Sun Jun 23, 2019 10:36 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

This doesn't assign the SpringSettings to anything which leaves it with zero-initialized values. Zero stiffness isn't a valid constraint configuration, so it causes an NaNsplosion. After some more testing I managed to figure this one out. There's no longer an error being produced, but now nothing h...
by tomweiland
Sun Jun 23, 2019 5:39 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

So I've been playing around with it, trying to get a PointOnLineServo working, but I'm having some issues. The code that I have I managed to piece together from the demos (although I couldn't find any that specifically use PointOnLineServos) and from reading the descriptions from v1 you provided, so...
by tomweiland
Fri Jun 21, 2019 3:28 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

Many games have adopted a fixed path approach for ladders. Rather than allowing free movement like Half-Life, interacting with a ladder attaches the character to the ladder and movement input just moves the character along a fixed path. This would be a little easier to handle since you could simply...
by tomweiland
Wed Jun 19, 2019 2:54 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

1) If the character.ViewDirection is not on the horizontal plane, that version will create a _worldMovementDirection which is not on the horizontal plane. In the CharacterDemo version, a second cross product is used to complete the horizontal basis. I've made sure it's horizontal. 2) The airAcceler...
by tomweiland
Tue Jun 18, 2019 5:32 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

I added a little example to the CharacterDemo showing one possible implementation: https://github.com/bepu/bepuphysics2/commit/3b790c292bd63567e919e0a0bcfc2f67376d5c73 This is great. After adapting my code a little, it now looks like the following: Vector3 _right = Vector3.Normalize(Vector3.Cross(_...
by tomweiland
Fri Jun 14, 2019 5:13 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

Here's one option: currentMovementVelocity = dot(movementDirection, currentVelocity) targetMovementVelocity = max(0, min(maximumSpeed, currentMovementVelocity + acceleration * dt)) changeInMovementVelocity = targetMovementVelocity - currentMovementVelocity currentVelocity += changeInMovementVelocit...
by tomweiland
Sun Jun 09, 2019 11:23 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

If you haven't already, updating to the latest version of the character would be wise just to avoid any of the bugs that got fixed. Just updated, it solved the issue of the character's linear momentum not being conserved, so that's great. In terms of air control though, I'm a little stuck. I don't ...
by tomweiland
Thu Jun 06, 2019 4:11 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

I went ahead and added some BodyReference impulse helpers (and fixed another character bug): https://github.com/bepu/bepuphysics2/commit/6de454ed73fc416d6e7d47063a39a803a0adcc90 Awesome, thanks! you could just do whatever you want to velocities to achieve your desired behavior. I'm thinking I'll pr...
by tomweiland
Wed Jun 05, 2019 4:34 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 473965

Re: Bepu v2 Character Controllers

So everything seems to be working properly now (still need to deal with stairs), but I noticed that there's no air control. Is there a built-in way to implement this? Additionally, when the character stands on a moving object—such as a ship—and jumps, he doesn't have the same velocity as the moving ...
by tomweiland
Sun Jun 02, 2019 7:36 pm
Forum: Questions and Help
Topic: Properly removing a body from the simulation (v2)
Replies: 9
Views: 42745

Re: Properly removing a body from the simulation (v2)

It should just return false if the body has been removed (or if the BodyReference instance is otherwise invalid or uninitialized). That's another bug, thanks for the report! :P No problem! Glad I could help out a little :) Fixed: https://github.com/bepu/bepuphysics2/commit/84b2dcf80942de3bacda3056b...
by tomweiland
Sun Jun 02, 2019 12:18 am
Forum: Questions and Help
Topic: Properly removing a body from the simulation (v2)
Replies: 9
Views: 42745

Re: Properly removing a body from the simulation (v2)

The character bug should now be fixed: https://github.com/bepu/bepuphysics2/commit/4649d6db72c0188a35f415165f5c9fb4beeeefd5 Sweet! Compounds should not have different behavior with respect to Bodies.Remove. I suspected that, but good to know. I do not observe any issues in the repro anymore (at lea...
by tomweiland
Thu May 30, 2019 11:01 pm
Forum: Questions and Help
Topic: Properly removing a body from the simulation (v2)
Replies: 9
Views: 42745

Re: Properly removing a body from the simulation (v2)

Are you saying I put the code that tries to remove the collider in a loop? I don't remember doing that :? I totally did make a loop :mrgreen: I did some more investigating in my actual project, and when the character controller isn't touching the test collider it get's removed with no errors. So it...
by tomweiland
Thu May 30, 2019 6:01 am
Forum: Questions and Help
Topic: Properly removing a body from the simulation (v2)
Replies: 9
Views: 42745

Re: Properly removing a body from the simulation (v2)

1) Removing a body that a character is standing on confuses the demos character controller; the character sees that it's not supported and tries to redundantly remove its motion constraint. That's a bug in the character- I'll look into fixing it tomorrow. Ok so that might explain why I was getting ...
by tomweiland
Thu May 30, 2019 1:55 am
Forum: Questions and Help
Topic: Properly removing a body from the simulation (v2)
Replies: 9
Views: 42745

Re: Properly removing a body from the simulation (v2)

I tried just adding a basic box and trying to remove it, and it gave me a different error: "Batch index must be within the set's batches buffer." I also checked the threading, and the removal code is running on the physics thread, so that shouldn't be an issue. Here's the link to the repro...