Просмотр исходного кода

Clarified how you update/save a CharacterVirtual

Jorrit Rouwe 6 месяцев назад
Родитель
Сommit
73da7f2d7b
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      Jolt/Physics/Character/CharacterVirtual.h

+ 3 - 2
Jolt/Physics/Character/CharacterVirtual.h

@@ -192,8 +192,9 @@ public:
 /// Runtime character object.
 /// This object usually represents the player. Contrary to the Character class it doesn't use a rigid body but moves doing collision checks only (hence the name virtual).
 /// The advantage of this is that you can determine when the character moves in the frame (usually this has to happen at a very particular point in the frame)
-/// but the downside is that other objects don't see this virtual character. In order to make this work it is recommended to pair a CharacterVirtual with a Character that
-/// moves along. This Character should be keyframed (or at least have no gravity) and move along with the CharacterVirtual so that other rigid bodies can collide with it.
+/// but the downside is that other objects don't see this virtual character. To make a CharacterVirtual visible to the simulation, you can optionally create an inner
+/// rigid body through CharacterVirtualSettings::mInnerBodyShape. A CharacterVirtual is not tracked by the PhysicsSystem so you need to update it yourself. This also means
+/// that a call to PhysicsSystem::SaveState will not save its state, you need to call CharacterVirtual::SaveState yourself.
 class JPH_EXPORT CharacterVirtual : public CharacterBase
 {
 public: