input
stringlengths
10
828
output
stringlengths
5
107
public boolean is touching return m flags touching flag touching flag
is this contact touching
public void set awake boolean flag if flag if m flags e awake flag 0 m flags e awake flag m sleep time 0 0f else m flags e awake flag m sleep time 0 0f m linear velocity set zero m angular velocity 0 0f m force set zero m torque 0 0f
set the sleep state of the body
public void set enabled boolean flag if flag m flags enabled flag else m flags enabled flag
enable disable this contact
public boolean is enabled return m flags enabled flag enabled flag
has this contact been disabled
public contact get next return m next
get the next contact in the worlds contact list
public fixture get fixture a return m fixture a
get the first fixture in this contact
public fixture get fixture b return m fixture b
get the second fixture in this contact
public boolean is awake return m flags e awake flag e awake flag
get the sleeping state of this body
public shape type get type return m shape get type
get the type of the child shape
public void flag for filtering m flags filter flag
flag this contact for filtering
public shape get shape return m shape
get the child shape
public void set sensor boolean sensor m is sensor sensor
set if this fixture is a sensor
public void set filter data final filter filter m filter set filter if m body null return flag associated contacts for filtering contact edge edge m body get contact list while edge null contact contact edge contact fixture fixture a contact get fixture a fixture fixture b contact get fixture b if fixture a this fixture b this contact flag for filtering edge edge next
set the contact filtering data
public filter get filter data return m filter
get the contact filtering data
public fixture get next return m next
get the next fixture in the parent bodys fixture list
public void set destruction listener destruction listener listener m destruction listener listener
register a destruction listener
public boolean is active return m flags e active flag e active flag
get the active state of the body
public void set contact filter contact filter filter m contact manager m contact filter filter
register a contact filter to provide specific control over collision
public boolean test point final vec2 p return m shape test point m body m xf p
test a point for containment in this fixture
public void set fixed rotation boolean flag if flag m flags e fixed rotation flag else m flags e fixed rotation flag reset mass data
set this body to have fixed rotation
public boolean raycast ray cast output output ray cast input input return m shape raycast output input m body m xf
cast a ray against this shape
public void get mass data mass data mass data m shape compute mass mass data m density
get the mass data for this fixture
public void set contact listener contact listener listener m contact manager m contact listener listener
register a contact event listener
public boolean is fixed rotation return m flags e fixed rotation flag e fixed rotation flag
does this body have fixed rotation
public aabb get aabb return m aabb
get the fixtures aabb
public void get closest point final vec2 out switch m count case 0 assert false out set zero return case 1 out set m v1 w return case 2 case22 set m v2 w mul local m v2 a case2 set m v1 w mul local m v1 a add local case22 out set case2 return case 3 out set zero return default assert false out set zero return
this returns pooled objects
public boolean should collide body other at least one body should be dynamic if m type body type dynamic other m type body type dynamic return false does a joint prevent collision for joint edge jn m joint list jn null jn jn next if jn other other if jn joint m collide connected false return false return true
this is used to prevent connected bodies from colliding
public body create body body def def assert is locked false if is locked return null todo djm pooling body b new body def this add to world doubly linked list b m prev null b m next m body list if m body list null m body list m prev b m body list b m body count return b
create a rigid body given a definition
public void set final manifold point cp local point set cp local point normal impulse cp normal impulse tangent impulse cp tangent impulse id set cp id
sets this manifold point form the given one
public void zero features flip 0 features incident edge 0 features incident vertex 0 features reference edge 0
zeros out the data
public void set manifold cp for int i 0 i cp point count i points i set cp points i type cp type local normal set cp local normal local point set cp local point point count cp point count
copies this manifold from the given one
public vec2 centroid final transform xf return transform mul xf m centroid
get the centroid and apply the supplied transform
public void clear forces for body body m body list body null body body get next body m force set zero body m torque 0 0f
call this after you are done with time steps to clear the forces
public vec2 centroid to out final transform xf final vec2 out transform mul to out xf m centroid out return out
get the centroid and apply the supplied transform
public void query aabb query callback callback aabb aabb wqwrapper broad phase m contact manager m broad phase wqwrapper callback callback m contact manager m broad phase query wqwrapper aabb
query the world for all fixtures that potentially overlap the
public mat22 get transform return box r
gets the transform of the viewport transforms around the center
public void set transform mat22 transform box r set transform
sets the transform of the viewport
public void mul by transform mat22 arg transform box r mul local arg transform
multiplies the obb transform by the given transform
public void raycast ray cast callback callback vec2 point1 vec2 point2 wrcwrapper broad phase m contact manager m broad phase wrcwrapper callback callback input max fraction 1 0f input p1 set point1 input p2 set point2 m contact manager m broad phase raycast wrcwrapper input
ray cast the world for all fixtures in the path of the ray
public contact get contact list return m contact manager m contact list
get the world contact list
public void set warm starting boolean flag m warm starting flag
enable disable warm starting
public void set continuous physics boolean flag m continuous physics flag
enable disable continuous physics
public int get proxy count return m contact manager m broad phase get proxy count
get the number of broad phase proxies
public int get contact count return m contact manager m contact count
get the number of contacts each may have 0 or more contact points
public void set gravity vec2 gravity m gravity set gravity
change the global gravity vector
public vec2 get gravity return m gravity
get the global gravity vector
public boolean is locked return m flags locked locked
is the world locked in the middle of a time step
public void set auto clear forces boolean flag if flag m flags clear forces else m flags clear forces
set flag to control automatic clearing of forces after each time step
public boolean get auto clear forces return m flags clear forces clear forces
get the flag that controls automatic clearing of forces after each time step
public void on module load flex table navi table new flex table navi table set style name navigator bar table image tasklog logo new image resources en us tasklog logo png navi table set widget 0 0 tasklog logo root panel get navigator add navi table display panel create make new tasklog panel
this is the entry point method
public void set min val double min val this min val min val
set the bottom edge of variability range for the parameter
public void set max val double max val this max val max val
set the upper edge of variability range for the parameter
public void set source file string file name throws illegal parameter value exception source file new file file name if source file exists throw new illegal parameter value exception file file name not found if source file is file throw new illegal parameter value exception file name is not a valid path
set the file name of the source file containing the parameter definition
public void insert update document event e button set enabled true
enable the button
public void remove update document event e button set enabled true
enable the button
public void action performed action event e button set enabled true
enable the button
private string get concat sql list string values if values size 1 return values get 0 else return start concat values get 0 sep concat get concat sql values sub list 1 values size end concat
recursive way of building concat instruction
public time type get time type return new time type
returns the actual database specific data type to use a time column
public char type get char type return new char type
returns the actual database specific data type to use for a char column
public varchar type get varchar type return new varchar type
returns the actual database specific data type to use for a varchar column
public nvarchar type get nvarchar type return new nvarchar type
returns the actual database specific data type to use for a varchar column
public float type get float type return new float type
returns the actual database specific data type to use for a float column
public double type get double type return new double type
returns the actual database specific data type to use for a double column
public int type get int type return new int type
returns the actual database specific data type to use for a int column
public tiny int type get tiny int type return new tiny int type
returns the actual database specific data type to use for a tinyint column
public void clear for int i 0 i cols length i cols i 0 for int i 0 i rows length i rows i 0
remove all objects from the implicit grid
public void set rigid and convex boolean p new if p new properties mask is rigid and convex else properties mask is rigid and convex
pass true if this body can be regarded as convex
public void init int p gravity int p visibility aabbs gravity p gravity visibility aabbs p visibility aabbs tmp dynamic bodies new vector tmp static bodies new vector tmp particles new vector collided tiles cache new int max collided tiles 2 object pools inited false inited true
inits the simulation
public void set sticky boolean p new ifdef debug if properties mask can stick 0 system out println can t stick nonsticky body endif if p new properties mask is sticky else properties mask is sticky
pass true if this body is allowed to stick to objects
public void die if p1 info mass point mask world point 0 p1 info mass point mask dead signal that this point will die if p2 null p2 info mass point mask world point 0 p2 info mass point mask dead p1 null signal that this spring should be removed if the game holds this pointer somewhere else
notifies this spring to break itself after next apply
public void notify points to unstick p1 info mass point mask is sticked mass point mask is sticked to world erase old info if p2 null p2 info mass point mask is sticked mass point mask is sticked to world else if p2 pos null p2 pos x integer max value signal the point should be deleted else we need to do nothing for spr sp2
tells the spring to die due to unsticking
public void set object int p id int p aabb set object p id p aabb 0 tile size shift p aabb 1 tile size shift p aabb 2 tile size shift p aabb 3 tile size shift
mark the presence of an object in the grid
public void add mass point mass point p point tmp mass points add element p point
adds mass point to the body definition
public void unset object int p id int p aabb unset object p id p aabb 0 tile size shift p aabb 1 tile size shift p aabb 2 tile size shift p aabb 3 tile size shift
unmark the presence of an object in the grid
public void move vector2 p move for int i 0 i sticked points len i sticked points i add p move vector2 pt new vector2 pos pos add p move if world ig static bodies null world ig static bodies update object id aabb local 0 pt x aabb local 1 pt y aabb local 2 pt x aabb local 3 pt y aabb local 0 pos x aabb local 1 pos y aabb local 2 pos x aabb local 3 pos y
moves this object by p move
public void translate vector2 p pos move p pos minus pos
changes position of this object to p pos
public void add sticked point vector2 p to add if sticked points null sticked points new vector2 8 else if sticked points len sticked points length vector2 tmp new vector2 sticked points len 1 system arraycopy sticked points 0 tmp 0 sticked points len sticked points tmp sticked points sticked points len p to add
for internal use only sticks a point to this body
public void remove dead sticked points for int i 0 i sticked points len i vector2 pt sticked points i if pt x integer max value sticked points len sticked points i null if i sticked points len sticked points i sticked points sticked points len sticked points sticked points len null i
for internal use clears data holding sticked points
public void d draw shape graphics p graph vector2 p offset int p edges color int len points length int positions new int len 2 for int i 0 i len i positions i 0 pos x points i x p offset x game draw shift positions i 1 pos y points i y p offset y game draw shift p graph set color p edges color for int i 0 j len 1 i len j i i p graph draw line positions i 0 positions i 1 positions j 0 positions j 1
draws a shape of this object useful for debug
public void clean points null pos null sticked points null aabb local null aabb null world null
clears memory allocated by this object
public void add mass points mass point p points for int i 0 i p points length i tmp mass points add element p points i
adds multiple mass points to the body definition
public vector2 get center pos return point pos
returns a position of the center no work is done
public void pre collision init point info mass point mask was colliding mass point mask was colliding with world mass point mask was colliding with movables erase old info
clears collision data for internal use
public void invalidate aabb aabb invalid true
clears info about aabb and forces it to update for internal use
public void update aabb implicit grid p ig int min x aabb 0 int min y aabb 1 int max x aabb 2 int max y aabb 3 aabb invalid true get aabb p ig update object id min x min y max x max y aabb 0 aabb 1 aabb 2 aabb 3
force update of the aabb for internal use
public void apply buyoancy int p water surface y int p gravity int p inv damping int ratio int long aabb 3 p water surface y math utils shift count long aabb 3 aabb 1 if ratio math utils shift koef ratio math utils shift koef if ratio 0 int force int long p gravity ratio math utils shift count 1 force point pos y point last pos y p inv damping add force times mass new vector2 0 force
apply water buoyancy to simulate swimming
public void clamp velocity vector2 v new vector2 point pos x point last pos x point pos y point last pos y if long v x v x long v y v y soft world max speed squared v normalise with shift point last pos x point pos x v x soft world max speed math utils shift count point last pos y point pos y v y soft world max speed math utils shift count
clamps the velocity if its too high to prevent tunneling for internal use
public void add mass points mass point p points vector2 p offset for int i 0 i p points length i p points i translate position p offset tmp mass points add element p points i
adds multiple mass points to the body definition
public vector2 get opposite return new vector2 x y
returns an opposite vector
public void add mass points vector2 p points vector2 p offset int p mass for int i 0 i p points length i tmp mass points add element new mass point p points i plus p offset p mass
adds multiple mass points to the body definition
public vector2 shift left x x math utils shift count y y math utils shift count return this
shift coords to the left
public vector2 shift left int p shift count x x math utils shift count p shift count y y math utils shift count p shift count return this
shift coords to the left by shift count p shift count
public void add mass points vector2 p points int p mass for int i 0 i p points length i tmp mass points add element new mass point p points i p mass
adds multiple mass points to the body definition
public vector2 shift right x x math utils shift count y y math utils shift count return this
similar to shift left
public vector2 shift right int p shift count x x math utils shift count p shift count y y math utils shift count p shift count return this
similar to shift left
public void add vector2 p to add x p to add x y p to add y
adds other vector to this vectors data
public void set center mass point mass point p point center point p point
sets a mass point which become the center point of this object
public void add int p x int p y x p x y p y
adds values to coords
public void multiply int p scalar x p scalar y p scalar
multiplies this vectors data by scalar
public void add spring spring p spring tmp springs add element p spring
adds an internal spring to this body