Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.InfoPhysics
Source: src/com/multiversesocial/hyperview/InfoPhysics.java

InfoPhysics

HyperView V3.23 — class
version V3.2 class

Summary

Three InfoSteps of the Info demo (V3.23), registered in InfoSteps.all() after the outline step. Each builds its examples in code when the step starts, animates in tick(), and puts back the settings it changed in teardown().

  1. RotationStep (gob-rotation): the same arrow at 0, 30, 60, 90 and 180 degrees with its outline polygon drawn; spinners with ROTATE_NEAREST and ROTATE_BILINEAR (the bilinear one is selected: its yellow polygon turns), and one that is also scaled by z.
  2. PhysicsStep (gob-physics): bouncing walls (CollisionManager.walls) and four lanes — R and B bounce with mass 1 and 3 (momentum and energy of the pair), Y and Z with restitution 0 go on together, P shoots T (45 hit points; damage = impact energy; T explodes and respawns), S is a RESPONSE_STOP ball that stops in the sand block.
  3. PickStep (gob-pick): a ring in front of a box (the hole lets the click through), a turned bar, an L turned by -20 degrees, two overlapping boxes. pickOnClick is on, so a real mouse click selects; when you do not click, a scripted probe (red cross) does it.

Source file: InfoPhysics.java. Checked by test/.../InfoRunTest.java. Reference: Info page (steps 25 to 27).

Hierarchy

Extends: none

Implements: HyperConstants

Used by: Info (through InfoSteps.all())

Referenced HyperView classes

Media files used

Declaration & members

public class InfoPhysics

Declared in src/com/multiversesocial/hyperview/InfoPhysics.java, lines 1–652. 8 field(s), 0 constructor(s), 10 method(s). Every member has an anchor you can link to (e.g. InfoPhysics.html#<id>).

Fields (8)

DeclarationValue / initializerDescriptionSource
static final int PEN_CYAN= 14 (constant)No comment in source.line 12
static final int PEN_DKGREY= 8 (constant)No comment in source.line 12
static final int PEN_GREEN= 5 (constant)No comment in source.line 12
static final int PEN_LTGREY= 9 (constant)No comment in source.line 12
static final int PEN_ORANGE= 6 (constant)No comment in source.line 12
static final int PEN_RED= 2 (constant)No comment in source.line 12
static final int PEN_WHITE= 1 (constant)No comment in source.line 12
static final int PEN_YELLOW= 3 (constant)No comment in source.line 12

Constructors (0)

SignatureDescriptionSource

Methods (10)

SignatureDescriptionSource
static BufferedImage arrowImg(int w, int h, int rgb)an arrow pointing right (the nose is the right end) with a round hole in the bodyline 28
static BufferedImage boxImg(int w, int h, int rgb)No comment in source.line 64
static BufferedImage discImg(int dia, int rgb)a disc with a white bar through its centre, so that a turn can be seenline 50
static String f1(double v)No comment in source.line 123
static Gob gobOf(InfoDispatch d, String name, BufferedImage img)sprites (drawn in code; every Gob's outline is traced from its alpha channel)line 16
static BufferedImage lImg(int w, int h, int rgb)No comment in source.line 88
static String pad(String s, int n)No comment in source.line 128
static void polyLines(InfoDispatch d, Polygon q, int pen)No comment in source.line 114
static BufferedImage ringImg(int dia, int hole, int rgb)No comment in source.line 76
static BufferedImage sandImg(int w, int h)No comment in source.line 99

Examples

// a step is an InfoStep: build() creates, tick() animates (about every 100 ms), teardown() puts settings back
l.add(new InfoPhysics.RotationStep());
l.add(new InfoPhysics.PhysicsStep());
l.add(new InfoPhysics.PickStep());
Hits--