/[cells]/cells-ode/primitives.lisp
ViewVC logotype

Contents of /cells-ode/primitives.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Sun Jun 1 20:26:49 2008 UTC (5 years, 10 months ago) by phildebrandt
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +17 -0 lines
added license
1 #|
2
3 Cells-ODE -- A cells driven interface to cl-ode
4
5 Copyright (C) 2008 by Peter Hildebrandt
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the Lisp Lesser GNU Public License
9 (http://opensource.franz.com/preamble.html), known as the LLGPL.
10
11 This library is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 See the Lisp Lesser GNU Public License for more details.
15
16 |#
17
18
19 ;;;
20 ;;; code to implement primitives (body + mass + geom)
21 ;;;
22
23 (in-package :c-ode)
24 ;;;
25 ;;; different body shapes
26 ;;;
27
28 (defmacro def-ode-prim (name &key mass-setter-args)
29 `(progn
30 (def-ode-model (,name :ode-class body) (body)
31 ((mass :ode nil)))
32 (defobserver mass ((self ,name) newval)
33 (when newval
34 (call-ode ,(intern-string 'mass-set name 'total) (((mass-obj self) object) (newval number) ,@mass-setter-args))))))
35
36 (def-ode-prim sphere
37 :mass-setter-args (((radius self) number)))
38
39 (def-ode-prim capped-cylinder
40 :mass-setter-args ((())))

  ViewVC Help
Powered by ViewVC 1.1.5