subject
Engineering, 20.06.2020 22:57 smith4kaay

In the PhysicsEngine object, write a method named isCollision that takes two GameObjects as parameters and returns a Boolean. The method returns true if the rectangular cuboids representing the objects overlap (ie. collide) and false otherwise. Study the GameObject class for details about how the rectangular cuboids are represented. Note: Objects do not collide if they are touching, but not intersecting (ie. make comparisons with strict inequalities instead of =). In the tests package, complete the test suite named TestCollisions to test this method. In the PhysicsEngine object, write a method named checkStaticCollision that takes a StaticObject and a DynamicObject as parameters and returns Unit. This method will:
1. Check if these objects collide (You can/should call your method from objective 1 to check for collisions)
2. If they collide
a. Call collideWithStaticObject on the dynamic object with the static object as an argument
b. Call collideWithDynamicObject on the static object with the dynamic object and the face as arguments. The face is the face of the static object with which the dynamic object collided. This lets the static object know which of the six faces were hit by the dynamic object allowing it to react differently to collisions on different sides. Review the Face object for the variable names of all the options.
c. You may assume that only 1 face collision occurs during an update and you should only test for these cases (Ex. If the collision occurs near an edge, or corner, computing the correct face becomes more difficult) i. Specifically, you may assume that the previous location "overlaps" with the static object in at least 2 dimensions
d. If the objects were already colliding, based on the dynamic object’s previous location, the colliding face should be "internal." In the tests package write a test suite named TestStaticCollision that tests this method.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified “x” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
question
Engineering, 04.07.2019 18:10
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
question
Engineering, 04.07.2019 18:10
Water at the rate of 1 kg/s is forced through a tube with a 2.5 cm inner diameter. the inlet water temperature is 15°c, and the outlet water temperature is 50°c. the tube wall temperature is 14°c higher than the local water temperature all along the length of the tube. what is the length of the tube?
Answers: 3
You know the right answer?
In the PhysicsEngine object, write a method named isCollision that takes two GameObjects as paramete...
Questions
question
Biology, 04.02.2020 16:53
question
History, 04.02.2020 16:53
question
Chemistry, 04.02.2020 16:53
Questions on the website: 13722363