final stretch-cursor pattern revision
This commit is contained in:
parent
9af73e8312
commit
394ad51ae6
1 changed files with 5 additions and 8 deletions
|
@ -7,23 +7,20 @@ class StretchCursor : dof {
|
|||
// data
|
||||
public Vec3 cursor;
|
||||
|
||||
public void Init() {
|
||||
cursor = to.position;
|
||||
}
|
||||
public void Init() {}
|
||||
|
||||
public void Frame() {
|
||||
Vec3 vec = to.position - from.position;
|
||||
float len = vec.Length;
|
||||
float stretch = Math.Max(len - deadzone, 0f);
|
||||
Vec3 dir = pointer ? vec / len : to.orientation * Vec3.Forward;
|
||||
Vec3 vec = to.position - from.position;
|
||||
float len = vec.Length;
|
||||
Vec3 dir = vec / len;
|
||||
|
||||
float stretch = Math.Max(len - deadzone, 0f);
|
||||
cursor = to.position + dir * stretch * strength;
|
||||
|
||||
Mesh.Cube.Draw(Material.Default, Matrix.TS(cursor, 0.01f));
|
||||
}
|
||||
|
||||
// design
|
||||
public bool pointer = false;
|
||||
public float deadzone = 0.1f;
|
||||
public float strength = 3f;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue