PPhys2D Home
A Phys2D adaptation for Processing.
  • information
  • reference
  • examples

Reference

  • Body Classes
    • PPBox
    • PPCircle
    • PPConvexPoly
    • PPLine
    • PPPoly
  • Body Functions
    • (PPBox)getHeight()
    • (PPBox)getWidth()
    • (PPBox)setSize()
    • (PPCircle)getSize()
    • (PPCircle)setSize()
    • addExcludedBody()
    • addForce()
    • adjustAngularVelocity()
    • adjustVelocity()
    • applyMatrix()
    • attachImage()
    • dettachImage()
    • getAngularVelocity()
    • getImageAlpha()
    • getRotation()
    • getVelocityX()
    • getVelocityY()
    • getX()
    • getY()
    • isResting()
    • isStatic()
    • isTouchingBody()
    • resetForces()
    • setAngularVelocity()
    • setDamping()
    • setDrawable()
    • setFillColor()
    • setFriction()
    • setGravityEffected()
    • setImageAlpha()
    • setMass()
    • setPosition()
    • setRestitution()
    • setRotatable()
    • setRotation()
    • setRotDamping()
    • setStaticBody()
    • setStrokeColor()
    • setStrokeWidth()
    • setVelocity()
  • World Classes
    • PPWorld
  • World Fucntions
    • add()
    • clear()
    • draw()
    • remove()
    • setDamping()
    • setEdges()
    • setEdgesFriction()
    • setEdgesRestitution()
    • setGravity()
    • step()

isTouchingBody()

Description

Check if a body is touching another specific body. If they are touching, it will return true. Else, it will return false.

Exemples

if(myBody1.isTouchingBody(myBody2)) {
//Will print only if myBody1 is touching myBody2
println("Yes, it is touching!");
}

Syntax

myBody.isTouching(body);

Parameters

body ->

PPBody : touching test will occur with this body.

Jean-Maxime Couillard - jm.couillard@globetrotter.net - Website bulit using CodeIgnitier PHP Engine with valid XHTML 1.0 Strict