ANIMATIONMANAGER Provides per frame paths for stimuli We integrate dyn4j java physics engine for rigid body. The plan is to also support sinusoidal, brownian, circular etc.
More...
ANIMATIONMANAGER Provides per frame paths for stimuli We integrate dyn4j java physics engine for rigid body. The plan is to also support sinusoidal, brownian, circular etc.
s = screenManager();
b = imageStimulus('size',4,'filePath','moon.png','name','moon');
b.speed = 25; % will define velocity
b.angle = -45; % will define velocity
a = animationManager();
sv = open(s); % open screen
setup(b, s); % initialise stimulus with open screen
addScreenBoundaries(a, sv); % add floor, ceiling and walls based on the screen
addBody(a, b); % add stimulus as a rigidbody to animationManager
setup(a); % initialise the simulation.
for i = 1:60
draw(b); % draw the stimulus
flip(s); % flip the screen
step(a); % step the simulation
end
@TODO build the code for the different types of motion
Copyright ©2014-2024 Ian Max Andolina — released: LGPL3, see LICENCE.md
|
function | animationManager (in varargin) |
| Class constructor.
|
|
function | addBody (in me, in stimulus, in shape, in type, in density, in friction, in elasticity, in av) |
|
function | editBody (in me, in body, in x, in y, in vx, in vy, in av) |
|
function | rmBody (in me, in id) |
|
function | resetBodies (in me) |
|
function | update (in me) |
|
function | setup (in me, in screen, in useBounds) |
|
function | isCollision (in me, in body) |
|
function | addScreenBoundaries (in me, in sv, in padding) |
| addScreenBoundaries add physical walls at the screen edges
|
|
function | step (in me, in varargin) |
|
function | reset (in me) |
| Load an image.
|
|
function | getBody (in me, in id) |
| return the first body matching name or hash
|
|
function | getFixture (in me, in name, in num) |
|
function | getBodyName (in me, in hash) |
|
function get | nBodies (in me) |
|
function | optickaCore (in varargin) |
| Class constructor.
|
|
function get | fullName (in me) |
|
function | getALF (in me, in subject, in sessionPrefix, in lab, in create) |
|
function | findAttributes (in me, in attrName, in attrValue) |
|
function | findAttributesandType (in me, in attrName, in attrValue, in type) |
| find properties of object with specific attributes, for example all properties whose GetAcccess attribute is public and type is logical.
|
|
function | findPropertyDefault (in me, in propName) |
|
function | clone (in me) |
| Use this syntax to make a deep copy of the object, i.e. OBJ_OUT has the same field values, but will not behave as a handle-copy of me anymore.
|
|
function | checkSuperclasses (in List) |
|
function | editProperties (in me, in properties) |
| method to modify a set of properties
|
|
function | setProp (in me, in property, in value) |
| method to fast change a particular value. This is useful for use in anonymous functions, like in the state machine.
|
|
function | initialiseGlobals (in me, in doReset, in doOpen) |
|
function | initialiseSaveFile (in me) |
| Initialise Save prefix.
|
|
function | checkPaths (in me) |
| checks the paths are valid
|
|
|
static function | vector2 (in x, in y) |
| dyn4j Vector2
|
|
static function | demo () |
|
static function | d2r (in degrees) |
| degrees2radians
|
|
static function | r2d (in r) |
| radians2degrees
|
|
static function | findDistance (in x1, in y1, in x2, in y2) |
| findDistance in X and Y coordinates
|
|
static function | updatePosition (in delta, in angle) |
| updatePosition returns dX and dY given an angle and delta
|
|
static function | bezier (in t, in P) |
| bezier function
|
|
static function | makeArgs (in args) |
| Converts cell args to structure array.
|
|
static function | addDefaults (in args, in defs) |
| add default options to arg input
|
|
static function | hasKey (in in, in key) |
| check if a struct / object has a propery / field
|
|
static function | getKeys (in device) |
| PTB Get key presses, stops key bouncing.
|
|
|
function | getBodyIDX (in me, in id) |
| return the first body matching name or hash
|
|
function | rigidStep (in me, in tick, in updatePositions) |
|
function | updateBodyPositions (in me) |
|
function | setupWorld (in me) |
|
function | setupBodies (in me) |
|
function | setupBody (in me, in thisBody) |
|
function | updateStimuli (in me) |
|
function | makeTrackIndex (in me) |
|
function | delete (in me) |
| delete is the object Destructor Destructor automatically called when object is cleared
|
|
function | parseArgs (in me, in args, in allowedProperties) |
| Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
|
|
function | addArgs (in me, in args) |
|
function | setPaths (in me) |
| Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
|
|
function | getFonts (in me) |
| set paths for object
|
|
function | toStructure (in me) |
| Converts properties to a structure.
|
|
function | getType (in me, in in) |
|
function | logOutput (in me, in in, in message, in override) |
| Give a metaproperty return the likely property class.
|
|
function | salutation (in me, in varargin) |
| Prints messages dependent on verbosity.
|
|