placed-object/get-dimensions [ Methods ]
[ Top ] [ placed-object ] [ Methods ]
Name
get-dimensions
File
placed-object.lsp
Description
Returns the amount of dimensions a placed-object has. (= length of lists in location and expansion slots)
Arguments
obj: a placed-object
Return Value
integer
Synopsis
(defgeneric get-dimensions (obj))
Example
(get-dimensions (event :location '(0 1 0))) --> 3
placed-object/get-distance [ Methods ]
[ Top ] [ placed-object ] [ Methods ]
Name
get-distance
File
placed-object.lsp
Description
Calculates the (closest) distance between to placed-objects or coordinates.
Arguments
obj1, obj2 (both lists or numbers, or both placed objects)
Return Value
number
Synopsis
(defgeneric get-distance (obj1 obj2))
Example
;;; (get-distance 0 1) -> 1.0 ;;; (get-distance '(0 0) '(1 1)) -> 1.4142135
placed-object/get-location-on-surface [ Methods ]
[ Top ] [ placed-object ] [ Methods ]
Name
get-location-on-surface
File
placed-object.lsp
Description
Returns a new location for obj1, which is on the surface or in the body of obj2. This is a pretty dump implementation: It simply clips location values for each axis to fit the targeted range. The resulting location is adjusted to the dimensions of obj2, simply filling in coordinates of obj2 for dimensions not specified in obj1. The expansion of obj1 will not be taken into consideration.
Arguments
obj1, obj2: two placed object (e.g. events or protagonists)
Return Value
number or list
Synopsis
(defgeneric get-location-on-surface (obj1 obj2))
Example
;;; (get-location-on-surface ;;; (make-event :location '(0 0)) ;;; (make-protagonist :sound :location '(1 4) :expansion '(2 2))) ;;; -> (0 3.0)
placed-object/placed-object [ Classes ]
Name
placed-object
File
placed-object.lsp
Slots
location, expansion, render-modes
Synopsis
(defclass placed-object () ((location :initarg :location :initform nil) (expansion :initarg :expansion :initform nil) (render-modes :initarg :render-modes :initform nil) (events :initarg :events :initform nil)))
placed-object/set-dimensions [ Methods ]
[ Top ] [ placed-object ] [ Methods ]
Name
set-dimensions
File
placed-object.lsp
Description
Sets the amount of dimensions of a placed-object. (= cuts the length of lists in location and expansion or fills it with 0s) If a value for location or expansion is nil, it will not be set!
Arguments
obj: a placed-object
Return Value
integer
Synopsis
(defgeneric set-dimensions (obj dimensions))
Example
(set-dimensions (event :location '(0 1 0)) 2) --> location: '(0 1) (set-dimensions (event :location '(0 1 0)) 4) --> location: '(0 1 0 0)