input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public void look at pvector target set view direction pvector sub target position
|
sets the camera
|
public pvector at return pvector add position view direction
|
returns a point defined in the world coordinate system where the camera is
|
public void fit sphere pvector center float radius if kind kind standard type type orthographic ortho size 1 look at scene center return float distance 0 0f switch type case perspective float yview radius papplet sin field of view 2 0f float xview radius papplet sin horizontal field of view 2 0f distance papplet max xview yview break case orthographic distance pvector dot pvector sub center arcball reference point view direction radius ortho coef break pvector new pos pvector sub center pvector mult view direction distance frame set position with constraint new pos
|
moves the camera so that the sphere defined by
|
public void fit bounding box pvector min pvector max float diameter papplet max papplet abs max y min y papplet abs max x min x diameter papplet max papplet abs max z min z diameter fit sphere pvector mult pvector add min max 0 5f 0 5f diameter
|
moves the camera so that the world axis aligned bounding box
|
public void draw arrow float length float radius float head 2 5f radius length 0 1f float cone radius coef 4 0f 5 0f head cylinder radius length 1 0f head cone radius coef pg3d translate 0 0f 0 0f length 1 0f head cone cone radius coef radius head length pg3d translate 0 0f 0 0f length 1 0f head
|
draws a 3 d arrow along the
|
public void draw arrow pvector from pvector to float radius pg3d push matrix pg3d translate from x from y from z pg3d apply matrix new quaternion new pvector 0 0 1 pvector sub to from matrix draw arrow pvector sub to from mag radius pg3d pop matrix
|
draws a 3 d arrow between the 3 d point
|
public void show entire scene fit sphere scene center scene radius
|
moves the camera so that the entire scene is visible
|
public void draw grid draw grid 100 10
|
convenience function that simply calls
|
public void center scene frame project on line scene center view direction
|
moves the camera so that its
|
public void draw grid float size draw grid size 10
|
convenience function that simply calls
|
public void draw grid int nb subdivisions draw grid 100 nb subdivisions
|
convenience function that simply calls
|
public void interpolate to frame fr interpolate to fr 1
|
convenience function that simply calls
|
public void draw camera camera camera draw camera camera 170 true 1 0f
|
convenience function that simply calls
|
public void interpolate to frame fr float duration if interpolation kfi interpolation is started interpolation kfi stop interpolation if any interpolation is started stop all interpolations interpolation kfi delete path interpolation kfi add key frame frame false interpolation kfi add key frame fr duration false interpolation kfi start interpolation
|
smoothly interpolates the camera on a key frame interpolator path so that it
|
public void draw camera camera camera float scale draw camera camera 170 true scale
|
convenience function that simply calls
|
public void draw camera camera camera int color draw camera camera color true 1 0f
|
convenience function that simply calls
|
public void stop all interpolations itrtr kfi key set iterator while itrtr has next integer key itrtr next if kfi get key interpolation is started kfi get key stop interpolation if interpolation kfi interpolation is started interpolation kfi stop interpolation
|
stops all interpolations currently being performed
|
public void draw camera camera camera boolean draw far plane draw camera camera 170 draw far plane 1 0f
|
convenience function that simply calls
|
public float iodistance return iodist
|
returns the users inter ocular distance in meters
|
public void draw camera camera camera boolean draw far plane float scale draw camera camera 170 draw far plane scale
|
convenience function that simply calls
|
public float physical distance to screen return physical dist2 scrn
|
returns the physical distance between the users eyes and the screen in
|
public void draw camera camera camera int color float scale draw camera camera color true scale
|
convenience function that simply calls
|
public void draw camera camera camera int color boolean draw far plane draw camera camera color draw far plane 1 0f
|
convenience function that simply calls
|
public float physical screen width return physical scrn width
|
returns the physical screen width in meters
|
public void set physical screen width float width physical scrn width width
|
sets the physical screen monitor or projected wall width in meters
|
public float focus distance return focus dist
|
returns the focus distance used by stereo display expressed in processing
|
public void set focus distance float distance if distance focus dist last frame update scene parent frame count focus dist distance
|
sets the focus distance in processing scene units
|
protected void draw arcball reference point hint pvector p camera projected coordinates of arcball reference point draw cross p x p y
|
draws visual hint a cross on the screen when the
|
protected void draw selection hints for mouse grabbable mg mouse grabber pool if mg instanceof interactive frame interactive frame i f interactive frame mg downcast needed if i f is in camera path pvector center camera projected coordinates of i f position if mg grabs mouse draw shooter target pg3d color 0 255 0 center i f grabs mouse threshold 1 2 else draw shooter target pg3d color 240 240 240 center i f grabs mouse threshold 1
|
draws all interactive frames selection regions a shooter target
|
protected void draw camera path selection hints for mouse grabbable mg mouse grabber pool if mg instanceof interactive frame interactive frame i f interactive frame mg downcast needed if i f is in camera path pvector center camera projected coordinates of i f position if mg grabs mouse draw shooter target pg3d color 0 255 255 center i f grabs mouse threshold 1 2 else draw shooter target pg3d color 255 255 0 center i f grabs mouse threshold 1
|
draws the selection regions a shooter target visual hint of
|
public void draw cross float px float py draw cross pg3d color 255 255 255 px py 15 3
|
convenience function that simply calls
|
public void draw filled circle int color pvector center float radius draw filled circle 40 color center radius
|
convenience function that simply calls
|
public pvector coords point p if start coord calls 1 throw new runtime exception begin screen drawing should be called before this method if pg3d get class processing core pgraphics3 d class return new pvector p x p y z c else return camera unprojected coordinates of new pvector p x p y z c
|
computes the world coordinates of the
|
protected void un set timer flag arp flag false pup flag false
|
called from the timer to stop displaying the point under pixel and arcball
|
private void init default camera profiles camera profile map new hash map string camera profile camera profile names new array list string current camera profile null register here the default profiles register camera profile new camera profile this arcball camera profile mode arcball register camera profile new camera profile this wheeled arcball camera profile mode wheeled arcball register camera profile new camera profile this first person camera profile mode first person set current camera profile arcball set current camera profile wheeled arcball
|
internal method that defines the default camera profiles wheeled arcball
|
public boolean unregister camera profile camera profile cp return unregister camera profile cp name
|
convenience function that simply returns
|
public boolean unregister camera profile string cp if is camera profile registered cp return false camera profile c profile camera profile cp int instances different than third person 0 for camera profile cam profile camera profile map values if cam profile mode camera profile mode third person instances different than third person if c profile mode camera profile mode third person instances different than third person 1 return false if is current camera profile cp next camera profile if camera profile names remove cp camera profile map remove cp return true return false
|
unregisters the given camera profile by its name
|
public camera profile camera profile string name return camera profile map get name
|
returns the camera profile which name matches the one provided
|
public boolean is camera profile registered camera profile cp return camera profile map contains value cp
|
returns true the given camera profile is currently registered
|
public boolean is camera profile registered string name return camera profile map contains key name
|
returns true if currently theres a camera profile registered by
|
public camera profile current camera profile return current camera profile
|
returns the current camera profile object
|
public boolean set current camera profile camera profile cp if cp null return false if is camera profile registered cp if register camera profile cp return false return set current camera profile cp name
|
set current the given camera profile
|
public void next camera profile int current camera profile index camera profile names index of current camera profile name next camera profile current camera profile index
|
sets the next registered camera profile as current
|
public void toggle keyboard handling enable keyboard handling keyboard handling
|
toggles the state of
|
public void enable keyboard handling boolean enable if enable enable keyboard handling else disable keyboard handling
|
enables or disables proscene keyboard handling according to
|
public void set path key character key integer path set path key desktop events get vkey key path
|
associates key frame interpolator path to key
|
public void set path key integer v key integer path if is path key in use v key integer p path v key papplet println warning overwritting path key which was previously binded to path p path keys set binding v key path
|
associates key frame interpolator path to the given virtual key
|
public integer path character key return path desktop events get vkey key
|
returns the key frame interpolator path associated with key
|
public integer path integer v key return path keys binding v key
|
returns the key frame interpolator path associated with key
|
public void remove path key character key remove path key desktop events get vkey key
|
removes the key frame interpolator shortcut
|
public void remove path key integer v key path keys remove binding v key
|
removes the key frame interpolator shortcut
|
public boolean is path key in use character key return is path key in use desktop events get vkey key
|
returns true if the given key binds a key frame interpolator path
|
public boolean is path key in use integer v key return path keys is shortcut in use v key
|
returns true if the given virtual key binds a key frame interpolator path
|
public void set add key frame keyboard modifier modifier modifier add key frame keyboard modifier modifier
|
sets the modifier key needed to play the key frame interpolator paths
|
public void set delete key frame keyboard modifier modifier modifier delete key frame keyboard modifier modifier
|
sets the modifier key needed to delete the key frame interpolator paths
|
public void set shortcut character key keyboard action action if is key in use key keyboard action a shortcut key papplet println warning overwritting shortcut which was previously binded to a g profile set binding new keyboard shortcut key action
|
defines a global keyboard shortcut to bind the given action
|
public void set shortcut integer mask character key keyboard action action set shortcut mask desktop events get vkey key action
|
defines a global keyboard shortcut to bind the given action
|
public void set shortcut integer mask integer v key keyboard action action if is key in use mask v key keyboard action a shortcut mask v key papplet println warning overwritting shortcut which was previously binded to a g profile set binding new keyboard shortcut mask v key action
|
defines a global keyboard shortcut to bind the given action
|
public void set shortcut integer v key keyboard action action if is key in use v key keyboard action a shortcut v key papplet println warning overwritting shortcut which was previously binded to a g profile set binding new keyboard shortcut v key action
|
defines a global keyboard shortcut to bind the given action
|
public void remove all shortcuts g profile remove all bindings
|
removes all global keyboard shortcuts
|
public void remove shortcut character key g profile remove binding new keyboard shortcut key
|
removes the global keyboard shortcut
|
public void remove shortcut integer mask integer v key g profile remove binding new keyboard shortcut mask v key
|
removes the global keyboard shortcut
|
public void remove shortcut integer v key g profile remove binding new keyboard shortcut v key
|
removes the global keyboard shortcut
|
public keyboard action shortcut character key return g profile binding new keyboard shortcut key
|
returns the action that is binded to the given global keyboard shortcut
|
public keyboard action shortcut integer mask character key return shortcut mask desktop events get vkey key
|
returns the action that is binded to the given global keyboard shortcut
|
public keyboard action shortcut integer mask integer v key return g profile binding new keyboard shortcut mask v key
|
returns the action that is binded to the given global keyboard shortcut
|
public keyboard action shortcut integer v key return g profile binding new keyboard shortcut v key
|
returns the action that is binded to the given global keyboard shortcut
|
public boolean is key in use character key return g profile is shortcut in use new keyboard shortcut key
|
returns true if the given global keyboard shortcut binds an action
|
public boolean is key in use integer mask integer v key return g profile is shortcut in use new keyboard shortcut mask v key
|
returns true if the given global keyboard shortcut binds an action
|
public boolean is key in use integer v key return g profile is shortcut in use new keyboard shortcut v key
|
returns true if the given global keyboard shortcut binds an action
|
public boolean is action binded keyboard action action return g profile is action mapped action
|
returns true if there is a global keyboard shortcut for the given action
|
public void display global help display global help true
|
convenience funstion that simply calls
|
public void display global help boolean on console if on console papplet println global help else on applet pg3d text font parent create font arial 12 pg3d text mode screen pg3d fill 0 255 0 pg3d text leading 20 pg3d text global help 10 10 pg3d width 20 pg3d height 20
|
displays global keyboard bindings
|
public void display current camera profile help display current camera profile help true
|
convenience function that simply calls
|
public void toggle mouse handling enable mouse handling mouse handling
|
toggles the state of
|
public void enable mouse handling boolean enable if enable enable mouse handling else disable mouse handling
|
enables or disables proscene mouse handling according to
|
public void enable mouse handling if mouse is handled return mouse handling true parent register mouse event d e
|
enables proscene mouse handling
|
public void disable mouse handling if mouse is handled return mouse handling false parent unregister mouse event d e
|
disables proscene mouse handling
|
public void add device hidevice device devices add device
|
adds an hidevice to the scene
|
public void remove device hidevice device devices remove device
|
removes the device from the scene
|
public void remove all devices devices clear
|
removes all registered devices from the scene
|
public void add draw handler object obj string method name try draw handler method obj get class get method method name new class scene class draw handler object obj draw handler method name method name catch exception e papplet println something went wrong when registering your method name method e print stack trace
|
attempt to add a draw handler method to the scene
|
public void remove draw handler draw handler method null draw handler object null draw handler method name null
|
unregisters the draw handler method if any has previously been added to
|
public float frame rate return target frame rate
|
returns the target frame rate
|
public void set frame rate float f rate set frame rate f rate true
|
convenience function that simply calls
|
public void set frame rate float f rate boolean restart target frame rate f rate parent frame rate target frame rate if animation is started restart restart animation
|
specifies the number of frames to be displayed every second
|
public float animation period return animation period
|
the animation loop period in milliseconds
|
public void set animation period float period set animation period period true
|
convenience function that simply calls
|
public void start animation animation started true sync with processing drawing method current animation frame 1 animated frame was triggered false if animation frame rate target frame rate parent frame rate animation frame rate bypass set frame rate else parent frame rate target frame rate same as set frame rate target frame rate false initial drawing frame when animation started parent frame count current animation frame 0 animation to frame rate ratio animation frame rate target frame rate
|
starts the animation loop
|
public void restart animation stop animation start animation
|
restart the animation
|
public void add animation handler object obj string method name try animate handler method obj get class get method method name new class scene class animate handler object obj animate handler method name method name catch exception e papplet println something went wrong when registering your method name method e print stack trace
|
attempt to add an animation handler method to the scene
|
public void remove animation handler animate handler method null animate handler object null animate handler method name null
|
unregisters the animation handler method if any has previously been added to
|
protected void set pprojection matrix compute the processing camera projection matrix from our camera parameters switch camera type case perspective pg3d perspective camera field of view camera aspect ratio camera z near camera z far break case orthographic float wh camera get ortho width height pg3d ortho wh 0 wh 0 wh 1 wh 1 camera z near camera z far break if our camera matrices are detached from the processing camera matrices we cache the processing camera projection matrix into our camera camera set projection matrix pg3d projection camera set projection matrix pgraphics3 d parent g projection
|
sets the processing camera projection matrix from
|
protected void set pmodel view matrix compute the processing camera modelview matrix from our camera parameters pg3d camera camera position x camera position y camera position z camera at x camera at y camera at z camera up vector x camera up vector y camera up vector z if our camera matrices are detached from the processing camera matrices we cache the processing camera modelview matrix into our camera camera set model view matrix pg3d modelview camera set projection matrix pgraphics3 d parent g modelview
|
sets the processing camera matrix from
|
private about jdialog get about jdialog if aboutj dialog null aboutj dialog new about jdialog get jframe return aboutj dialog
|
this method initializes about dialog
|
private hilfe jdialog get hilfe jdialog if hilfej dialog null hilfej dialog new hilfe jdialog get jframe return hilfej dialog
|
this method initializes hilfe dialog
|
private jmenu item get hilfe menu item if hilfe menu item null hilfe menu item new jmenu item hilfe menu item set background net sf econtycoon core data mod data textfield color hilfe menu item set text strings get string gui 0 hilfe menu item add action listener new action listener public void action performed action event e hilfe jdialog hilfe dialog get hilfe jdialog point loc get jframe get location loc translate 20 20 hilfe dialog set location loc hilfe dialog set visible true return hilfe menu item
|
this method initializes j menu item
|
private jmenu item get about menu item if about menu item null about menu item new jmenu item about menu item set background net sf econtycoon core data mod data textfield color about menu item set text strings get string gui 1 non nls 1 about menu item add action listener new action listener public void action performed action event e about jdialog about dialog get about jdialog point loc get jframe get location loc translate 20 20 about dialog set location loc about dialog set visible true return about menu item
|
this method initializes j menu item
|
private jmenu item get exit menu item if exit menu item null exit menu item new jmenu item exit menu item set background net sf econtycoon core data mod data textfield color exit menu item set text strings get string gui 2 non nls 1 exit menu item add action listener new action listener public void action performed action event e system exit 0 return exit menu item
|
this method initializes j menu item
|
private jmenu get file menu if file menu null file menu new jmenu file menu set background net sf econtycoon core data mod data textfield color file menu set text strings get string gui 3 non nls 1 file menu add get menu datei neues spiel file menu add get menu datei pause file menu add get menu datei speichern file menu add get menu datei laden file menu add get menu datei optionen file menu add get exit menu item return file menu
|
this method initializes j menu
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.