Documentation
¶
Overview ¶
virtual is Virtual World file format, it is used to make binary world more human readable and editable
Index ¶
- Variables
- type ActorAction
- type ActorDef
- type ActorInst
- type ActorLevelOfDetail
- type AmbientLight
- type AsciiReadToken
- type AttachedSkin
- type BSPNode
- type DMSprite
- type DMSpriteDef
- type DMSpriteDef2
- type DMSpriteDefRenderGroup
- type DMSpriteDefSize6Entry
- type DMSpriteDefSpritePolygon
- type DMSpriteDefVertexPiece
- type Dag
- type Face
- type GlobalAmbientLightDef
- type HierarchicalSpriteDef
- type LightDef
- type MaterialDef
- type MaterialPalette
- type MeshOp
- type NullFloat32
- type NullFloat32Slice3
- type NullFloat32Slice4
- type NullFloat32Slice6
- type NullFloat64
- type NullInt16
- type NullInt32
- type NullInt64
- type NullInt8
- type NullString
- type NullUint16
- type NullUint32
- type NullUint64
- type NullUint8
- type Obstacle
- type PointLight
- type PolyhedronDefinition
- type PolyhedronDefinitionFace
- type PropOpt
- type RGBTrack
- type RGBTrackDef
- type Region
- type SimpleSpriteDef
- type SimpleSpriteFrame
- type Sprite3DDef
- type TrackDef
- type TrackFrameTransform
- type TrackInstance
- type VisList
- type VisNode
- type VisTree
- type Wall
- type Wld
- type WldDefinitioner
- type WorldNode
- type WorldTree
- type Zone
Constants ¶
This section is empty.
Variables ¶
var AsciiVersion = "v0.0.1"
Functions ¶
This section is empty.
Types ¶
type ActorAction ¶ added in v1.4.113
type ActorAction struct { Unk1 uint32 LevelOfDetails []ActorLevelOfDetail }
ActorAction is a declaration of ACTION
type ActorDef ¶ added in v1.4.118
type ActorDef struct { Tag string Callback string BoundsRef int32 CurrentAction NullUint32 Location NullFloat32Slice6 ActiveGeometry NullUint32 Unk1 uint32 Actions []ActorAction Unk2 uint32 // contains filtered or unexported fields }
ActorDef is a declaration of ACTORDEF
func (*ActorDef) Definition ¶ added in v1.4.125
func (*ActorDef) Read ¶ added in v1.4.125
func (e *ActorDef) Read(r *AsciiReadToken) error
type ActorInst ¶ added in v1.4.118
type ActorInst struct { Tag string DefinitionTag string CurrentAction NullUint32 Location NullFloat32Slice6 BoundingRadius NullFloat32 Scale NullFloat32 SoundTag NullString Active NullUint32 SpriteVolumeOnly NullUint32 DMRGBTrackTag NullString SphereTag string SphereRadius float32 UserData string // contains filtered or unexported fields }
ActorInst is a declaration of ACTORINST
func (*ActorInst) Definition ¶ added in v1.4.125
func (*ActorInst) Read ¶ added in v1.4.125
func (e *ActorInst) Read(r *AsciiReadToken) error
type ActorLevelOfDetail ¶ added in v1.4.118
ActorLevelOfDetail is a declaration of LEVELOFDETAIL
type AmbientLight ¶ added in v1.4.128
type AmbientLight struct { Tag string LightTag string LightFlags uint32 Regions []uint32 // contains filtered or unexported fields }
func (*AmbientLight) Definition ¶ added in v1.4.128
func (e *AmbientLight) Definition() string
func (*AmbientLight) Read ¶ added in v1.4.128
func (e *AmbientLight) Read(r *AsciiReadToken) error
type AsciiReadToken ¶ added in v1.4.120
type AsciiReadToken struct {
// contains filtered or unexported fields
}
func LoadAsciiFile ¶ added in v1.4.121
func LoadAsciiFile(path string, wld *Wld) (*AsciiReadToken, error)
LoadAsciiFile returns a new AsciiReader that reads from r.
func (*AsciiReadToken) Close ¶ added in v1.4.121
func (a *AsciiReadToken) Close() error
func (*AsciiReadToken) Read ¶ added in v1.4.120
func (a *AsciiReadToken) Read(p []byte) (n int, err error)
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered.
func (*AsciiReadToken) ReadProperty ¶ added in v1.4.120
func (a *AsciiReadToken) ReadProperty(name string, minNumArgs int) ([]string, error)
func (*AsciiReadToken) TotalLineCountRead ¶ added in v1.4.124
func (a *AsciiReadToken) TotalLineCountRead() int
type AttachedSkin ¶ added in v1.4.123
type BSPNode ¶ added in v1.4.118
type BSPNode struct { Vertices []uint32 RenderMethod string Pen NullUint32 Brightness NullFloat32 ScaledAmbient NullFloat32 SpriteTag NullString UvOrigin NullFloat32Slice3 UAxis NullFloat32Slice3 VAxis NullFloat32Slice3 Uvs [][2]float32 TwoSided int FrontTree uint32 BackTree uint32 }
BSPNode is a declaration of BSPNODE
type DMSprite ¶ added in v1.4.130
type DMSprite struct { Tag string DefinitionTag string Param uint32 // contains filtered or unexported fields }
DMSprite is a declaration of DMSPRITEINSTANCE
func (*DMSprite) Definition ¶ added in v1.4.130
func (*DMSprite) Read ¶ added in v1.4.130
func (e *DMSprite) Read(r *AsciiReadToken) error
type DMSpriteDef ¶ added in v1.4.130
type DMSpriteDef struct { Tag string Flags uint32 Fragment1Maybe int16 Material string Fragment3 uint32 CenterPosition [3]float32 Params2 uint32 Something2 uint32 Something3 uint32 Verticies [][3]float32 TexCoords [][3]float32 Normals [][3]float32 Colors []int32 Polygons []*DMSpriteDefSpritePolygon VertexPieces []*DMSpriteDefVertexPiece PostVertexFlag uint32 RenderGroups []*DMSpriteDefRenderGroup VertexTex [][2]float32 Size6Pieces []*DMSpriteDefSize6Entry // contains filtered or unexported fields }
DMSpriteDef is a declaration of DMSPRITEDEF
func (*DMSpriteDef) Definition ¶ added in v1.4.139
func (e *DMSpriteDef) Definition() string
func (*DMSpriteDef) Read ¶ added in v1.4.139
func (e *DMSpriteDef) Read(r *AsciiReadToken) error
type DMSpriteDef2 ¶ added in v1.4.116
type DMSpriteDef2 struct { Tag string Flags uint32 DmTrackTag string Fragment3Ref int32 Fragment4Ref int32 Params2 [3]uint32 MaxDistance float32 Min [3]float32 Max [3]float32 CenterOffset [3]float32 Vertices [][3]float32 UVs [][2]float32 VertexNormals [][3]float32 VertexColors [][4]uint8 SkinAssignmentGroups [][2]uint16 MaterialPaletteTag string Faces []*Face MeshOps []*MeshOp FaceMaterialGroups [][2]uint16 VertexMaterialGroups [][2]int16 BoundingRadius float32 FPScale uint16 PolyhedronTag string // contains filtered or unexported fields }
DMSpriteDef2 is a declaration of DMSpriteDef2
func (*DMSpriteDef2) Definition ¶ added in v1.4.120
func (e *DMSpriteDef2) Definition() string
func (*DMSpriteDef2) Read ¶ added in v1.4.120
func (e *DMSpriteDef2) Read(r *AsciiReadToken) error
type DMSpriteDefRenderGroup ¶ added in v1.4.130
type DMSpriteDefSize6Entry ¶ added in v1.4.130
type DMSpriteDefSpritePolygon ¶ added in v1.4.130
type DMSpriteDefVertexPiece ¶ added in v1.4.130
type GlobalAmbientLightDef ¶ added in v1.4.145
type GlobalAmbientLightDef struct { Tag string // contains filtered or unexported fields }
GlobalAmbientLightDef is a declaration of GLOBALAMBIENTLIGHTDEF
func (*GlobalAmbientLightDef) Definition ¶ added in v1.4.145
func (e *GlobalAmbientLightDef) Definition() string
func (*GlobalAmbientLightDef) Read ¶ added in v1.4.145
func (e *GlobalAmbientLightDef) Read(r *AsciiReadToken) error
type HierarchicalSpriteDef ¶ added in v1.4.123
type HierarchicalSpriteDef struct { Tag string Dags []Dag AttachedSkins []AttachedSkin CenterOffset NullFloat32Slice3 BoundingRadius NullFloat32 CollisionVolumeTag string // contains filtered or unexported fields }
func (*HierarchicalSpriteDef) Definition ¶ added in v1.4.123
func (e *HierarchicalSpriteDef) Definition() string
func (*HierarchicalSpriteDef) Read ¶ added in v1.4.123
func (e *HierarchicalSpriteDef) Read(r *AsciiReadToken) error
type LightDef ¶ added in v1.4.118
type LightDef struct { Tag string Flags uint32 CurrentFrame NullUint32 Sleep NullUint32 LightLevels []float32 Colors [][3]float32 // contains filtered or unexported fields }
LightDef is a declaration of LIGHTDEF
func (*LightDef) Definition ¶ added in v1.4.125
func (*LightDef) Read ¶ added in v1.4.125
func (e *LightDef) Read(r *AsciiReadToken) error
type MaterialDef ¶ added in v1.4.116
type MaterialDef struct { Tag string // TAG %s RenderMethod string // RENDERMETHOD %s RGBPen [4]uint8 // RGBPEN %d %d %d Brightness float32 // BRIGHTNESS %0.7e ScaledAmbient float32 // SCALEDAMBIENT %0.7e SimpleSpriteTag string // SIMPLESPRITEINST Pair1 NullUint32 Pair2 NullFloat32 // contains filtered or unexported fields }
MaterialDef is an entry MATERIALDEFINITION
func (*MaterialDef) Definition ¶ added in v1.4.121
func (e *MaterialDef) Definition() string
func (*MaterialDef) Read ¶ added in v1.4.121
func (e *MaterialDef) Read(r *AsciiReadToken) error
type MaterialPalette ¶ added in v1.4.116
type MaterialPalette struct { Tag string Materials []string // contains filtered or unexported fields }
MaterialPalette is a declaration of MATERIALPALETTE
func (*MaterialPalette) Definition ¶ added in v1.4.120
func (e *MaterialPalette) Definition() string
func (*MaterialPalette) Read ¶ added in v1.4.120
func (e *MaterialPalette) Read(r *AsciiReadToken) error
type NullFloat32 ¶ added in v1.4.145
type NullFloat32Slice3 ¶ added in v1.4.145
type NullFloat32Slice4 ¶ added in v1.4.147
type NullFloat32Slice6 ¶ added in v1.4.145
type NullFloat64 ¶ added in v1.4.145
type NullFloat64 sql.NullFloat64
type NullString ¶ added in v1.4.145
type NullString sql.NullString
type NullUint16 ¶ added in v1.4.145
type NullUint32 ¶ added in v1.4.145
type NullUint64 ¶ added in v1.4.145
type PointLight ¶ added in v1.4.118
type PointLight struct { Tag string LightFlags uint32 LightTag string Flags uint32 Location [3]float32 Radius float32 // contains filtered or unexported fields }
PointLight is a declaration of POINTLIGHT
func (*PointLight) Definition ¶ added in v1.4.125
func (e *PointLight) Definition() string
func (*PointLight) Read ¶ added in v1.4.125
func (e *PointLight) Read(r *AsciiReadToken) error
type PolyhedronDefinition ¶ added in v1.4.120
type PolyhedronDefinition struct { Tag string Flags uint32 BoundingRadius float32 ScaleFactor float32 Vertices [][3]float32 Faces []*PolyhedronDefinitionFace // contains filtered or unexported fields }
func (*PolyhedronDefinition) Definition ¶ added in v1.4.120
func (e *PolyhedronDefinition) Definition() string
func (*PolyhedronDefinition) Read ¶ added in v1.4.120
func (e *PolyhedronDefinition) Read(r *AsciiReadToken) error
type PolyhedronDefinitionFace ¶ added in v1.4.120
type PolyhedronDefinitionFace struct {
Vertices []uint32
}
type RGBTrack ¶ added in v1.4.133
type RGBTrack struct { Tag string DefinitionTag string Flags uint32 // contains filtered or unexported fields }
RGBTrack is a track instance for RGB deformation tracks
func (*RGBTrack) Definition ¶ added in v1.4.133
func (*RGBTrack) Read ¶ added in v1.4.133
func (e *RGBTrack) Read(token *AsciiReadToken) error
type RGBTrackDef ¶ added in v1.4.133
type RGBTrackDef struct { Tag string Data1 uint32 Data2 uint32 Data4 uint32 Sleep uint32 RGBAs [][4]uint8 // contains filtered or unexported fields }
func (*RGBTrackDef) Definition ¶ added in v1.4.133
func (e *RGBTrackDef) Definition() string
func (*RGBTrackDef) Read ¶ added in v1.4.133
func (e *RGBTrackDef) Read(token *AsciiReadToken) error
type Region ¶ added in v1.4.113
type Region struct { Tag string RegionFog int Gouraud2 int EncodedVisibility int VisListBytes int AmbientLightTag string RegionVertices [][3]float32 RenderVertices [][3]float32 Walls []*Wall Obstacles []*Obstacle CuttingObstacles []*Obstacle VisTree *VisTree Sphere [4]float32 ReverbVolume float32 ReverbOffset int32 UserData string SpriteTag string // contains filtered or unexported fields }
func (*Region) Definition ¶ added in v1.4.128
func (*Region) Read ¶ added in v1.4.128
func (e *Region) Read(token *AsciiReadToken) error
type SimpleSpriteDef ¶ added in v1.4.116
type SimpleSpriteDef struct { Tag string SkipFrames NullUint32 Sleep NullUint32 CurrentFrame NullInt32 Animated NullUint32 SimpleSpriteFrames []SimpleSpriteFrame // contains filtered or unexported fields }
SimpleSpriteDef is a declaration of SIMPLESPRITEDEF
func (*SimpleSpriteDef) Definition ¶ added in v1.4.121
func (e *SimpleSpriteDef) Definition() string
func (*SimpleSpriteDef) Read ¶ added in v1.4.121
func (e *SimpleSpriteDef) Read(r *AsciiReadToken) error
type SimpleSpriteFrame ¶ added in v1.4.129
type Sprite3DDef ¶ added in v1.4.118
type Sprite3DDef struct { Tag string CenterOffset NullFloat32Slice3 BoundingRadius NullFloat32 SphereListTag string Vertices [][3]float32 BSPNodes []*BSPNode // contains filtered or unexported fields }
Sprite3DDef is a declaration of SPRITE3DDEF
func (*Sprite3DDef) Definition ¶ added in v1.4.125
func (e *Sprite3DDef) Definition() string
func (*Sprite3DDef) Read ¶ added in v1.4.125
func (s *Sprite3DDef) Read(r *AsciiReadToken) error
type TrackDef ¶ added in v1.4.120
type TrackDef struct { Tag string FrameTransforms []TrackFrameTransform // contains filtered or unexported fields }
func (*TrackDef) Definition ¶ added in v1.4.120
func (*TrackDef) Read ¶ added in v1.4.120
func (e *TrackDef) Read(r *AsciiReadToken) error
type TrackFrameTransform ¶ added in v1.4.120
type TrackFrameTransform struct { XYZScale int16 XYZ [3]float32 RotScale NullInt16 Rotation NullFloat32Slice3 LegacyRotation NullFloat32Slice4 }
type TrackInstance ¶ added in v1.4.120
type TrackInstance struct { Tag string DefinitionTag string Interpolate int Reverse int Sleep NullUint32 // contains filtered or unexported fields }
func (*TrackInstance) Definition ¶ added in v1.4.120
func (e *TrackInstance) Definition() string
func (*TrackInstance) Read ¶ added in v1.4.120
func (e *TrackInstance) Read(r *AsciiReadToken) error
type Wld ¶
type Wld struct { FileName string GlobalAmbientLight *GlobalAmbientLightDef Version uint32 SimpleSpriteDefs []*SimpleSpriteDef MaterialDefs []*MaterialDef MaterialPalettes []*MaterialPalette DMSpriteDefs []*DMSpriteDef DMSpriteInsts []*DMSprite DMSpriteDef2s []*DMSpriteDef2 ActorDefs []*ActorDef ActorInsts []*ActorInst LightDefs []*LightDef PointLights []*PointLight Sprite3DDefs []*Sprite3DDef TrackInstances []*TrackInstance TrackDefs []*TrackDef HierarchicalSpriteDefs []*HierarchicalSpriteDef PolyhedronDefs []*PolyhedronDefinition WorldTrees []*WorldTree Regions []*Region AmbientLights []*AmbientLight Zones []*Zone RGBTrackDefs []*RGBTrackDef RGBTrackInsts []*RGBTrack // contains filtered or unexported fields }
Wld is a struct representing a Wld file
func (*Wld) ByTag ¶ added in v1.4.138
func (wld *Wld) ByTag(tag string) WldDefinitioner
ByTag returns a instance by tag
func (*Wld) WriteAscii ¶ added in v1.4.113
type WldDefinitioner ¶ added in v1.4.138
type WorldTree ¶ added in v1.4.128
type WorldTree struct { Tag string WorldNodes []*WorldNode // contains filtered or unexported fields }
func (*WorldTree) Definition ¶ added in v1.4.128
func (*WorldTree) Read ¶ added in v1.4.128
func (e *WorldTree) Read(r *AsciiReadToken) error
type Zone ¶ added in v1.4.128
type Zone struct { Tag string Regions []uint32 UserData string // contains filtered or unexported fields }
func (*Zone) Definition ¶ added in v1.4.128
func (*Zone) Read ¶ added in v1.4.128
func (e *Zone) Read(r *AsciiReadToken) error