ShipEditor

From SfzWiki
Revision as of 23:04, 14 November 2005 by Ghoulsblade (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

OLM

  • ObjectOriented-Lowpoly-Modeller
  • Prism Based -> enhanced Interior Detection and Mesh-Management

TODO

// TODO : NameSpace for Editor ? (or just for whole project)
// TODO : Research : Multiple Inheritance : Con-/Destructor Calling and Order
// TODO : Research : Multiple Inheritance : automatic casting ??? or static_cast<Type>(ptr)
// TODO : Research : Trac : auto-generate tickers from doxygen TODOs
// TODO : Research : Exceptions 
// TODO : Research : Python for Editor ?
// TODO : Research : DesignPattern : Mnemonic/InnerState for Create/Destroy-Command
// Todo : Research : DesignPattern : Builder -> ComponentBuilder
Interface:iPointable
list<SmartPointer>
// Destructor calls NotifyDestroy() of all pointers (ListenerPattern)

SmartPointer<Type>
iPointable
Type operator * ()
Type operator -> ()
void	NotifyDestroy	(); // DesignPattern:Listener
// TODO : Research : DesignPattern : SmartPointer
Interface:iEditable
list<VertexPtr> listVertices();
abstract	void	Move	(Vec3 v);
abstract	void	Scale	(Vec3 v,Vec3 o);
abstract	void	Scale	(Vec3 v);
abstract	void	Rotate	(Quaternion q,Vec3 o);
abstract	void	Rotate	(Quaternion q);
Vec3	GetBoundsMin	();
Vec3	GetBoundsMax	();
Vec3	GetBoundsCenter	();
Vec3	GetPivot		();
Component
Vec3			pos;
list<Vec3>		top;
list<Vec3>		bot;
int				flags;
ComponentType*	type;
ComponentGroup* parent; // smartptr ?
EditComponent	GetEditComponent	(); // null or overridden
ComponentType
// SteelFrame,TitanFrame,Cockpit...
EditComponent
// lists for selected vertices,edges,sides and whole component
Selection
// Selection != Group, as selection can be mutliple vertices/faces/lines...


ComponentGroup
list<Component> elements;
EditComponentGroup
// type of elements = EditComponent, use Component->GetEditComponent()


Gizmo
bool MouseOver(Vec3 o,Vec3 v);
// click+drag // TODO : Research : CEGUI click+drag handling
digraph G { 
Gizmo -> AxisGizmo -> { MoveGizmo, ScaleGizmo };
Gizmo -> RotateGizmo;
}
digraph G { 
Component -> { Inner, Hull };
ComponentBuilder -> Component;
}


digraph G { 

Component;
GameComponent -> Component;
EditComponent -> {Component,iEditable};

Selection -> iEditable;

Component;

ComponentGroup -> Component;

EditComponentGroup -> {ComponentGroup,iEditable}
}


Editing

  • All Operations use the Command Pattern, to support Undo/Redo
  • Uses Mnemonic/Inner State Pattern for Create/Destroy
  • Python Support ??
  • Commands bindable to Buttons, MenuItems, Right-Click Menu....

Move,Scale,Rotate

  • when Tool is active, show the apropriate gizmo in scene
  • gizmo acts on Current Selection (iEditable)
  • gizmo gives visual MouseOver feedback
  • support snapping

Creation

  • CreateFrameComponent : Activates a Create-Mode :
  • click(first corner) + drag(2d base) + click(3d)
  • gizmo gives visual feedback during creation
  • support snapping

Selection

  • types/smartpointers for vertex,edge,side
  • Selection managed as (named)list of those types
  • Selection depends on active "type" (vertex,edge,side,component,group), no mixing
  • select gizmo (rectangle)
  • Toggle select on intersect or only on complete containment
  • manual selection with shift(add) and control(remove)
  • when selection from list, and last selection was manually altered, save last manual selection as named
  • undo for selection
  • group select : when group is already selected, click selects subgroup


Picking

in popup :

  • current selection,
  • named selection,
  • hierarchy list (groups)
  • pick-by-click (current mode : vertex,edge,side,component,group)

Tools

  • ToolPanel = view, Tool = model(singleton) -> model/view seperation, change-listener
  • Tool->CreatePanel()
  • Python Support ??
  • Tools can "pick" current selection, named selection, groups, or pick-by-click
  • Named Selections (depends on current mode (vertex,edge,side,component,group)) + Select/Unselect/Show/Hide/Delete
  • Mode Selection (vertex,edge,side,component,group)
  • Tool Selection (Select,Move,Scale,Rotate,Extrude,Bevel,SpinExtrude,SpinBevel)
  • Snap (Grid,Vertex,Edge,Face)
  • AngleSnap (edit+on/off button + buttons for 20 30 40 45 60 90)
  • Name+Group / Ungroup
  • Hierarchy-List (also for popup)
  • Change Parent (opens hierarchy-list popup)
  • Later : Change Type (popup : for compatible types, eg titanframe -> steelframe ??)
  • Later : Change Side (point,line,3up,3down,square,penta,[x]:popup)

only for top/bottom, autoconvert if top/bottom <= 4

  • Later : Toggle select on intersect or only on complete containment
  • Later : QuickCut/Slice (component, : DrawLine Gizmo
  • Later : Create Adapter : pick operand a,b
  • Later : ExtrudeAroundEdge,TurnAroundEdge (pick edge + turn selection)
  • Later : SoftSelection (falloff:distance/adjactance,falloff:linear,cubic,curve,falloffdist)
  • Later : Dock : move 2 sides together and link them, pick base(not moved) and operand (modifyed)
  • Later : Constraints/Links + LockSize (link 2 sides of different components, only move, not scale group)
  • Later : Prism-Based Subdivide (height/width)
  • Later : Hide/Show Selection/All


Gizmos

  • scalable with +/-
  • mouseovereffekt, areas : axis,area-between

Click / Drag Handling

  • TODO : Research : CEGUI
  • Tool/Mode/Gizmo can activate "MouseMode", abort on esc,rightclick

and when another MouseMode is activated

Spawning/ObjectCreation

  • MouseMode
  • Frame/Cockpit :
    • click on side : extrude/bevel
    • click on empty : create in space/ on grid

Inclusion/Intersection Warning

  • not possible for space ships, breaks interior-definition,

and enables cheating (ultra compact, multi-dimensional cargo bays)

   ---
  /\X/\
 /  -  \
 -------