Search found 44 matches

by tomweiland
Thu Jun 27, 2019 3:49 pm
Forum: Questions and Help
Topic: Bepu 2 mesh shape causes crash!
Replies: 26
Views: 938

Re: Bepu 2 mesh shape causes crash!

A little update: I started working on terrain generation a few days ago, so I had to come back to using meshes. This time, I decided to construct the mesh programmatically, directly on the server (instead of extracting vertices/indices from Unity) and it works great. That makes me think that maybe t...
by tomweiland
Wed Jun 26, 2019 1:50 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 84
Views: 1970

Re: Bepu v2 Character Controllers

Since my compound isn't entirely symmetrical, the center of mass is slightly offset, which makes positioning the ladder in the middle a bit of a pain (especially since I'll have to adjust it every time I modify the compound). Is there any way to pass a shape with a mass of 0 to CompoundBuilder.Add()...
by tomweiland
Tue Jun 25, 2019 11:44 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 84
Views: 1970

Re: Bepu v2 Character Controllers

If you're concerned only with attaching constraints to the child, then it's equivalent to attaching to the parent compound since the child is associated with the same body. It would just require taking into account the child's relative location. That's what I had in mind, and I suspected this would...
by tomweiland
Mon Jun 24, 2019 11:38 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 84
Views: 1970

Re: Bepu v2 Character Controllers

How about downwards movement? :P https://github.com/bepu/bepuphysics2/commit/1f2bc4583df038b2805825d24ced659f97fa26d1 Yep, it's working now! I should be able to take it from here, but I have one more question. Is it possible to use a specific piece of a compound body as the "ladder" collider? I'd n...
by tomweiland
Mon Jun 24, 2019 12:05 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 84
Views: 1970

Re: Bepu v2 Character Controllers

Yes, the character constraints will interfere unless disabled. Whether that interference matters is another question. Making the PointOnLineServo strong enough to overpower the character's MaximumHorizontalForce and the LinearAxisMotor strong enough to overpower the character's MaximumVerticalForce...
by tomweiland
Sun Jun 23, 2019 11:29 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 84
Views: 1970

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: 84
Views: 1970

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: 84
Views: 1970

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: 84
Views: 1970

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: 84
Views: 1970

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: 84
Views: 1970

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: 84
Views: 1970

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: 84
Views: 1970

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: 84
Views: 1970

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: 84
Views: 1970

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 ...