Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
tutorials:advanced:cram-rigid-body [2022/07/11 13:08] – vanessa | tutorials:advanced:cram-rigid-body [2022/07/11 13:14] – small rigid-body update vanessa | ||
---|---|---|---|
Line 6: | Line 6: | ||
(defmethod add-object ((world bt-world) (type (eql : | (defmethod add-object ((world bt-world) (type (eql : | ||
& | & | ||
+ | |||
(make-item world name (list type) | (make-item world name (list type) | ||
(list | (list | ||
(make-instance | (make-instance | ||
' | ' | ||
- | :name 'waterdrop1 | + | :name 'waterdrop |
: | : | ||
: | : | ||
Line 17: | Line 18: | ||
</ | </ | ||
+ | The type of this rigid body should be associated with liquid-minor, | ||
+ | The name should also be different in this example it is waterdrop. | ||
+ | The collision shape is important for the whole shape of the new body. You can choose between the following: | ||
+ | |||
<code lisp> | <code lisp> | ||
+ | (defclass colored-cylinder-shape (cylinder-shape colored-shape-mixin) ()) | ||
+ | (defclass colored-static-plane-shape (static-plane-shape colored-shape-mixin) ()) | ||
+ | (defclass colored-sphere-shape (sphere-shape colored-shape-mixin) ()) | ||
+ | (defclass colored-cone-shape (cone-shape colored-shape-mixin) ()) | ||
+ | (defclass colored-compound-shape (compound-shape colored-shape-mixin) ()) | ||
+ | (defclass colored-convex-hull-shape (convex-hull-shape colored-shape-mixin) ()) | ||
</ | </ | ||
+ | Now you can spawn the rigid body as a new object in the bullet world via: | ||
+ | <code lisp> | ||
+ | (btr:: | ||
+ | </ |