-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
149 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(in-package :cl-chipmunk) | ||
|
||
(defun cp-body-new (mass moment) | ||
(%chip:cp-body-new (df mass) (df moment))) | ||
|
||
(defun cp-body-free (shape) | ||
(%chip:cp-body-free shape)) | ||
|
||
(defun cp-body-set-position (body pos) | ||
(with-set-vect (v pos) | ||
(%chip:cp-body-set-position body v))) | ||
|
||
(defun cp-body-get-position (body) | ||
(with-returned-vect (ret) | ||
(%chip:cp-body-get-position ret body))) | ||
|
||
|
||
(defun cp-body-set-velocity (body velocity) | ||
(with-set-vect (v velocity) | ||
(%chip:cp-body-set-velocity body v))) | ||
|
||
(defun cp-body-get-velocity (body) | ||
(with-returned-vect (ret) | ||
(%chip:cp-body-get-velocity ret body))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(in-package :cl-chipmunk) | ||
|
||
(defun cp-segment-shape-new (body a b radius) | ||
(plus-c:c-with ((aa %chipmunk:cp-vect) | ||
(bb %chipmunk:cp-vect)) | ||
(lisp->cp-vect aa a) | ||
(lisp->cp-vect bb b) | ||
(%chip:cp-segment-shape-new body aa bb (coerce radius 'double-float)))) | ||
|
||
(defun cp-shape-free (shape) | ||
(%chip:cp-shape-free shape)) | ||
|
||
(defun cp-shape-set-friction (shape friction) | ||
(%chip:cp-shape-set-friction shape (df friction))) | ||
|
||
(defun cp-shape-get-friction (shape) | ||
(%chip:cp-shape-get-friction shape)) | ||
|
||
(defun cp-Moment-For-Circle (m r1 r2 &optional (offset (rtg-math:v! 0 0))) | ||
(with-vect (v) | ||
(lisp->cp-vect v offset) | ||
(%chip:cp-moment-for-circle (df m) | ||
(df r1) | ||
(df r2) | ||
v))) | ||
|
||
(defun cp-circle-shape-new (body radius &optional offset) | ||
(unless offset | ||
(setf offset (rtg-math:v! 0 0))) | ||
(with-set-vect (v offset) | ||
(%chip:cp-circle-shape-new body (df radius) v))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters