Search found 99 matches

by tomweiland
Thu May 30, 2019 12:25 am
Forum: Questions and Help
Topic: Properly removing a body from the simulation (v2)
Replies: 9
Views: 43605

Properly removing a body from the simulation (v2)

I'm trying to remove a body from the simulation, but when I use Simulation.Bodies.Remove(bodyHandle) it gives me an error, saying "Index out of range" on line 66 of the Buffer class. Maybe there's an example on how to do this somewhere in the demos, but I'm not sure where to start looking....
by tomweiland
Tue May 28, 2019 1:45 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

For a character with a mass of 1, a force of 20 goes from a velocity of 4 to ~0 (1e-10) in 12 frames of 1/60f each. At a force of 240, it takes a single timestep to go from 4 to ~0. Got it. In the following, the normal is created by a vertex and the rounded capsule shape. That's what I was envision...
by tomweiland
Mon May 27, 2019 11:25 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

a sufficiently high horizontal force What kind of range are you talking about here? A value of ~50? 250? 1000? The character will only attempt to use surfaces as supports if the contact normal is not too steep. Contact normals are not identical to the surface normal right? So the surface normal cou...
by tomweiland
Mon May 27, 2019 5:24 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

So I've been playing around with the various values and properties and I've noticed two things. First, the character "drifts" after letting go of a key. While this is physically accurate behavior, it's a little hard to control and not how characters usually behave in games. It seems that n...
by tomweiland
Sun May 26, 2019 11:56 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

In the repro, after it starts moving, the character falls over. If you want the character to never rotate, set the characterInertia.InverseInertiaTensor = default. You could also control the rotation in other ways (velocity setting, angular constraint, etc.). I totally overlooked that. That's what ...
by tomweiland
Sun May 26, 2019 11:11 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

If you're seeing much larger intersection, then I would suspect some form of visualization bug. In both the main demos and in the repro provided it is working as expected. The intersection is quite a bit larger, more like 0.25-0.4 units with -9.8 gravity. It doesn't seem to be a visualization bug, ...
by tomweiland
Sun May 26, 2019 10:39 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

a capsule character's body position is near the character's waist. That's how it was when I was just applying velocity, before I added the built-in character controller stuff. Now the capsule is either sinking into the floor or BodyReference.Pose.Position is returning a Vector3 that doesn't represe...
by tomweiland
Sun May 26, 2019 10:26 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

Yep that fixed it! Thank you!

I noticed I'm sliding a lot so I'll have to play with the configuration, but I also noticed that the visual representation of the character seems to be partially in the ground. Is the character's origin at his feet or at his waist?
by tomweiland
Sun May 26, 2019 9:19 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

I was able to reproduce the issue in a fresh console app. Unfortunately the file was to big to upload here, so here's the Google Drive link.
by tomweiland
Sun May 26, 2019 6:47 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

Is the AnalyzeContactsForCharacterRegion ever seeing a support contact? That would be anywhere in this branch: https://github.com/bepu/bepuphysics2/blob/master/Demos/Demos/Characters/CharacterControllers.cs#L558 I stuck a breakpoint in there and it isn't being hit. Is this running on CoreCLR, or a ...
by tomweiland
Sun May 26, 2019 5:10 am
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

1) Are any constraints ever being created in CharacterControllers.AnalyzeContacts? (There are two calls to Simulation.Solver.Add in that function, are either ever hit?) Neither of the two calls are being hit. 2) Are the constraints ever hit? (StaticCharacterMotionFunctions.Prestep or DynamicCharact...
by tomweiland
Sat May 25, 2019 11:37 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

Ok so both CharacterControllers.TryReportContacts and CharacterControllers.Initialize are being called.
by tomweiland
Sat May 25, 2019 11:19 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

Also confirm that CharacterControllers.PrepareForContacts and CharacterControllers.AnalyzeContacts are actually getting run. If not, the event handlers weren't hooked up, which implies the CharacterControllers.Initialize function wasn't called. (In the CharacterDemo, this takes place in the Charact...
by tomweiland
Sat May 25, 2019 7:40 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

If you want to reliably beckon John, you should use his name rather than where he was sitting at some arbitrary time. So I guess I shouldn't even bother storing the character index that the AllocateCharacter method spits out? Characters have a configurable maximum force property. You're referring t...
by tomweiland
Thu May 23, 2019 11:46 pm
Forum: Questions and Help
Topic: Bepu v2 Character Controllers
Replies: 89
Views: 481475

Re: Bepu v2 Character Controllers

This thread has a reasonably deep dive on how the v1 version worked (among other things), which mostly maps onto how the version in the v2 demos works: https://forum.bepuentertainment.com/viewtopic.php?f=4&t=2545 This was very helpful! Pretty much, yes. The CharacterDemo is probably the most co...