wce

package
v1.4.231 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

virtual is Virtual World file format, it is used to make binary world more human readable and editable

Index

Constants

This section is empty.

Variables

View Source
var AsciiVersion = "v0.0.1"

Functions

This section is empty.

Types

type ActorAction

type ActorAction struct {
	Unk1           uint32
	LevelOfDetails []ActorLevelOfDetail
}

ActorAction is a declaration of ACTION

type ActorDef

type ActorDef struct {
	Tag            string
	Callback       string
	BoundsRef      int32
	CurrentAction  NullUint32
	Location       NullFloat32Slice6
	ActiveGeometry NullUint32
	Unk1           uint32
	Actions        []ActorAction
	Unk2           uint32
	HasEightyFlag  int
	// contains filtered or unexported fields
}

ActorDef is a declaration of ACTORDEF

func (*ActorDef) Definition

func (e *ActorDef) Definition() string

func (*ActorDef) FromRaw

func (e *ActorDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragActorDef) error

func (*ActorDef) Read

func (e *ActorDef) Read(token *AsciiReadToken) error

func (*ActorDef) ToRaw

func (e *ActorDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*ActorDef) Write

func (e *ActorDef) Write(token *AsciiWriteToken) error

type ActorInst

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
	HexTwoHundredFlag int
	UserData          string
	// contains filtered or unexported fields
}

ActorInst is a declaration of ACTORINST

func (*ActorInst) Definition

func (e *ActorInst) Definition() string

func (*ActorInst) FromRaw

func (e *ActorInst) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragActor) error

func (*ActorInst) Read

func (e *ActorInst) Read(token *AsciiReadToken) error

func (*ActorInst) ToRaw

func (e *ActorInst) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*ActorInst) Write

func (e *ActorInst) Write(token *AsciiWriteToken) error

type ActorLevelOfDetail

type ActorLevelOfDetail struct {
	SpriteTag      string
	SpriteTagIndex int
	SpriteFlags    uint32
	MinDistance    float32
}

ActorLevelOfDetail is a declaration of LEVELOFDETAIL

type AmbientLight

type AmbientLight struct {
	Tag        string
	LightTag   string
	LightFlags uint32
	Regions    []uint32
	// contains filtered or unexported fields
}

func (*AmbientLight) Definition

func (e *AmbientLight) Definition() string

func (*AmbientLight) FromRaw

func (e *AmbientLight) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragAmbientLight) error

func (*AmbientLight) Read

func (e *AmbientLight) Read(token *AsciiReadToken) error

func (*AmbientLight) ToRaw

func (e *AmbientLight) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*AmbientLight) Write

func (e *AmbientLight) Write(token *AsciiWriteToken) error

type AsciiReadToken

type AsciiReadToken struct {
	// contains filtered or unexported fields
}

func LoadAsciiFile

func LoadAsciiFile(path string, wce *Wce) (*AsciiReadToken, error)

LoadAsciiFile returns a new AsciiReader that reads from r.

func (*AsciiReadToken) Close

func (a *AsciiReadToken) Close() error

func (*AsciiReadToken) ReadLine

func (a *AsciiReadToken) ReadLine() (string, 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

func (a *AsciiReadToken) ReadProperty(name string, minNumArgs int) ([]string, error)

func (*AsciiReadToken) ReadSegmentedLine

func (a *AsciiReadToken) ReadSegmentedLine() ([]string, error)

func (*AsciiReadToken) TotalLineCountRead

func (a *AsciiReadToken) TotalLineCountRead() int

type AsciiWriteToken

type AsciiWriteToken struct {
	// contains filtered or unexported fields
}

func NewAsciiWriteToken

func NewAsciiWriteToken(path string, wce *Wce) *AsciiWriteToken

func (*AsciiWriteToken) AddWriter

func (a *AsciiWriteToken) AddWriter(tag string, path string) error

func (*AsciiWriteToken) Close

func (a *AsciiWriteToken) Close()

func (*AsciiWriteToken) IsWriterUsed

func (a *AsciiWriteToken) IsWriterUsed(tag string) bool

func (*AsciiWriteToken) SetWriter

func (a *AsciiWriteToken) SetWriter(tag string) error

func (*AsciiWriteToken) TagClearIsWritten

func (a *AsciiWriteToken) TagClearIsWritten()

func (*AsciiWriteToken) TagIsWritten

func (a *AsciiWriteToken) TagIsWritten(tag string) bool

TagIsWritten returns true if the tag was already written

func (*AsciiWriteToken) TagSetIsWritten

func (a *AsciiWriteToken) TagSetIsWritten(tag string)

func (*AsciiWriteToken) UseTempWriter added in v1.4.216

func (a *AsciiWriteToken) UseTempWriter(tag string) (*os.File, error)

func (*AsciiWriteToken) Writer

func (a *AsciiWriteToken) Writer() (*os.File, error)

func (*AsciiWriteToken) WriterByTag

func (a *AsciiWriteToken) WriterByTag(tag string) (*os.File, error)

Writer returns the file writer for a given tag

type AttachedSkin

type AttachedSkin struct {
	DMSpriteTag               string
	LinkSkinUpdatesToDagIndex uint32
}

type BSPNode

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 BlitSpriteDef added in v1.4.228

type BlitSpriteDef struct {
	Tag         string
	SpriteTag   string
	Unknown     int32
	Transparent int16
	// contains filtered or unexported fields
}

BlitSpriteDef is a declaration of BLITSPRITEDEF

func (*BlitSpriteDef) Definition added in v1.4.228

func (e *BlitSpriteDef) Definition() string

func (*BlitSpriteDef) FromRaw added in v1.4.228

func (e *BlitSpriteDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragBlitSpriteDef) error

func (*BlitSpriteDef) Read added in v1.4.228

func (e *BlitSpriteDef) Read(token *AsciiReadToken) error

func (*BlitSpriteDef) ToRaw added in v1.4.228

func (e *BlitSpriteDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*BlitSpriteDef) Write added in v1.4.228

func (e *BlitSpriteDef) Write(token *AsciiWriteToken) error

type DMSpriteDef

type DMSpriteDef struct {
	Tag                  string
	Fragment1            int16
	MaterialPaletteTag   string
	Fragment3            uint32
	Center               NullFloat32Slice3
	Params1              [3]float32
	Vertices             [][3]float32
	TexCoords            [][2]float32
	Normals              [][3]float32
	Colors               []int32
	Faces                []*DMSpriteDefFace
	Meshops              []*DMSpriteDefMeshOp
	SkinAssignmentGroups [][2]uint16
	Data8                []uint32 // 0x200 flag
	FaceMaterialGroups   [][2]int16
	VertexMaterialGroups [][2]int16
	Params2              NullFloat32Slice3
	Params3              NullFloat32Slice6
	HexTwoHundredFlag    int16
	HexEightHundredFlag  int16
	HexOneThousandFlag   int16
	// contains filtered or unexported fields
}

DMSpriteDef is a declaration of DMSPRITEDEF

func (*DMSpriteDef) Definition

func (e *DMSpriteDef) Definition() string

func (*DMSpriteDef) FromRaw

func (e *DMSpriteDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragDMSpriteDef) error

func (*DMSpriteDef) Read

func (e *DMSpriteDef) Read(token *AsciiReadToken) error

func (*DMSpriteDef) ToRaw

func (e *DMSpriteDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*DMSpriteDef) Write

func (e *DMSpriteDef) Write(token *AsciiWriteToken) error

type DMSpriteDef2

type DMSpriteDef2 struct {
	Tag                   string
	DmTrackTag            string
	Params2               [3]uint32
	BoundingBoxMin        [3]float32
	BoundingBoxMax        [3]float32
	CenterOffset          [3]float32
	Vertices              [][3]float32
	UVs                   [][2]float32
	VertexNormals         [][3]float32
	VertexColors          [][4]uint8
	SkinAssignmentGroups  [][2]int16
	MaterialPaletteTag    string
	Faces                 []*Face
	MeshOps               []*MeshOp
	FaceMaterialGroups    [][2]uint16
	VertexMaterialGroups  [][2]int16
	BoundingRadius        float32
	FPScale               uint16
	PolyhedronTag         string
	HexOneFlag            uint16
	HexTwoFlag            uint16
	HexFourThousandFlag   uint16
	HexEightThousandFlag  uint16
	HexTenThousandFlag    uint16
	HexTwentyThousandFlag uint16
	// contains filtered or unexported fields
}

DMSpriteDef2 is a declaration of DMSpriteDef2

func (*DMSpriteDef2) Definition

func (e *DMSpriteDef2) Definition() string

func (*DMSpriteDef2) FromRaw

func (e *DMSpriteDef2) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragDmSpriteDef2) error

func (*DMSpriteDef2) Read

func (e *DMSpriteDef2) Read(token *AsciiReadToken) error

func (*DMSpriteDef2) ToRaw

func (e *DMSpriteDef2) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*DMSpriteDef2) Write

func (e *DMSpriteDef2) Write(token *AsciiWriteToken) error

type DMSpriteDefFace

type DMSpriteDefFace struct {
	Flags         uint16
	Data          [4]uint16
	VertexIndexes [3]uint16
}

type DMSpriteDefMeshOp

type DMSpriteDefMeshOp struct {
	TypeField   uint32
	VertexIndex uint32
	Offset      float32
	Param1      uint16
	Param2      uint16
}

type DMTrackDef2

type DMTrackDef2 struct {
	Tag     string
	Sleep   uint16
	Param2  uint16
	FPScale uint16
	Frames  [][][3]float32
	Size6   uint16
	// contains filtered or unexported fields
}

func (*DMTrackDef2) Definition

func (e *DMTrackDef2) Definition() string

func (*DMTrackDef2) FromRaw

func (e *DMTrackDef2) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragDmTrackDef2) error

func (*DMTrackDef2) Read

func (e *DMTrackDef2) Read(token *AsciiReadToken) error

func (*DMTrackDef2) ToRaw

func (e *DMTrackDef2) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*DMTrackDef2) Write

func (e *DMTrackDef2) Write(token *AsciiWriteToken) error

type Dag

type Dag struct {
	Tag        string
	Track      string
	TrackIndex int
	SubDags    []uint32
	SpriteTag  string
}

type EQFace added in v1.4.205

type EQFace struct {
	Index        [3]uint32
	MaterialName string
	HexOneFlag   int
}

type EQMaterialDef added in v1.4.205

type EQMaterialDef struct {
	Tag               string
	ShaderTag         string
	HexOneFlag        int
	Properties        []*MaterialProperty
	AnimationSleep    uint32
	AnimationTextures []string
	// contains filtered or unexported fields
}

EQMaterialDef is an entry EQMATERIALDEF

func (*EQMaterialDef) Definition added in v1.4.205

func (e *EQMaterialDef) Definition() string

func (*EQMaterialDef) FromRaw added in v1.4.205

func (e *EQMaterialDef) FromRaw(wce *Wce, src *raw.Material) error

func (*EQMaterialDef) Read added in v1.4.205

func (e *EQMaterialDef) Read(token *AsciiReadToken) error

func (*EQMaterialDef) ToRaw added in v1.4.205

func (e *EQMaterialDef) ToRaw(wce *Wce, dst *raw.Material) error

func (*EQMaterialDef) Write added in v1.4.205

func (e *EQMaterialDef) Write(token *AsciiWriteToken) error

type Face

type Face struct {
	Passable int
	Triangle [3]uint16
}

type Frame added in v1.4.210

type Frame struct {
	XYZScale int16
	XYZ      [3]int16
	RotScale int16
	Rotation [3]int16
}

type GlobalAmbientLightDef

type GlobalAmbientLightDef struct {
	Color [4]uint8
	// contains filtered or unexported fields
}

GlobalAmbientLightDef is a declaration of GLOBALAMBIENTLIGHTDEF

func (*GlobalAmbientLightDef) Definition

func (e *GlobalAmbientLightDef) Definition() string

func (*GlobalAmbientLightDef) FromRaw

func (e *GlobalAmbientLightDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragGlobalAmbientLightDef) error

func (*GlobalAmbientLightDef) Read

func (e *GlobalAmbientLightDef) Read(token *AsciiReadToken) error

func (*GlobalAmbientLightDef) ToRaw

func (e *GlobalAmbientLightDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*GlobalAmbientLightDef) Write

func (e *GlobalAmbientLightDef) Write(token *AsciiWriteToken) error

type HierarchicalSpriteDef

type HierarchicalSpriteDef struct {
	Tag                   string
	Dags                  []Dag
	AttachedSkins         []AttachedSkin
	CenterOffset          NullFloat32Slice3 // 0x01
	BoundingRadius        NullFloat32       // 0x02
	HexTwoHundredFlag     int               // 0x200
	HexTwentyThousandFlag int               // 0x20000
	PolyhedronTag         string
	// contains filtered or unexported fields
}

func (*HierarchicalSpriteDef) Definition

func (e *HierarchicalSpriteDef) Definition() string

func (*HierarchicalSpriteDef) FromRaw

func (e *HierarchicalSpriteDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragHierarchicalSpriteDef) error

func (*HierarchicalSpriteDef) Read

func (e *HierarchicalSpriteDef) Read(token *AsciiReadToken) error

func (*HierarchicalSpriteDef) ToRaw

func (e *HierarchicalSpriteDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*HierarchicalSpriteDef) Write

func (e *HierarchicalSpriteDef) Write(token *AsciiWriteToken) error

type LegacyFrame added in v1.4.210

type LegacyFrame struct {
	XYZScale int16
	XYZ      [3]int16
	Rotation [4]float32
}

type LightDef

type LightDef struct {
	Tag          string
	CurrentFrame NullUint32
	Sleep        NullUint32
	SkipFrames   int
	LightLevels  []float32
	Colors       [][3]float32
	// contains filtered or unexported fields
}

LightDef is a declaration of LIGHTDEF

func (*LightDef) Definition

func (e *LightDef) Definition() string

func (*LightDef) FromRaw

func (e *LightDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragLightDef) error

func (*LightDef) Read

func (e *LightDef) Read(token *AsciiReadToken) error

func (*LightDef) ToRaw

func (e *LightDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*LightDef) Write

func (e *LightDef) Write(token *AsciiWriteToken) error

type MaterialDef

type MaterialDef struct {
	Tag                string
	Variation          int
	SpriteHexFiftyFlag int
	RenderMethod       string
	RGBPen             [4]uint8
	Brightness         float32
	ScaledAmbient      float32
	SimpleSpriteTag    string
	Pair1              NullUint32
	Pair2              NullFloat32
	DoubleSided        int
	// contains filtered or unexported fields
}

MaterialDef is an entry MATERIALDEFINITION

func (*MaterialDef) Definition

func (e *MaterialDef) Definition() string

func (*MaterialDef) FromRaw

func (e *MaterialDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragMaterialDef) error

func (*MaterialDef) Read

func (e *MaterialDef) Read(token *AsciiReadToken) error

func (*MaterialDef) ToRaw

func (e *MaterialDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*MaterialDef) Write

func (e *MaterialDef) Write(token *AsciiWriteToken) error

type MaterialPalette

type MaterialPalette struct {
	Tag string

	Materials []string
	// contains filtered or unexported fields
}

MaterialPalette is a declaration of MATERIALPALETTE

func (*MaterialPalette) Definition

func (e *MaterialPalette) Definition() string

func (*MaterialPalette) FromRaw

func (e *MaterialPalette) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragMaterialPalette) error

func (*MaterialPalette) Read

func (e *MaterialPalette) Read(token *AsciiReadToken) error

func (*MaterialPalette) ToRaw

func (e *MaterialPalette) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*MaterialPalette) Write

func (e *MaterialPalette) Write(token *AsciiWriteToken) error

type MaterialProperty added in v1.4.205

type MaterialProperty struct {
	Name     string
	Category uint32
	Value    string
}

type MdsDef added in v1.4.203

type MdsDef struct {
	Tag      string
	Version  uint32
	Vertices [][3]float32
	Normals  [][3]float32
	Tints    [][4]uint8
	UVs      [][2]float32
	UV2s     [][2]float32
	Faces    []*EQFace
	// contains filtered or unexported fields
}

MdsDef is an entry EQSKINNEDMODELDEF

func (*MdsDef) Definition added in v1.4.203

func (e *MdsDef) Definition() string

func (*MdsDef) FromRaw added in v1.4.203

func (e *MdsDef) FromRaw(wce *Wce, src *raw.Mds) error

func (*MdsDef) Read added in v1.4.203

func (e *MdsDef) Read(token *AsciiReadToken) error

func (*MdsDef) ToRaw added in v1.4.203

func (e *MdsDef) ToRaw(wce *Wce, dst *raw.Mds) error

func (*MdsDef) Write added in v1.4.203

func (e *MdsDef) Write(token *AsciiWriteToken) error

type MeshOp

type MeshOp struct {
	Index1    uint16
	Index2    uint16
	Offset    float32
	Param1    uint8
	TypeField uint8
}

type ModDef added in v1.4.203

type ModDef struct {
	Tag      string
	Version  uint32
	Vertices [][3]float32
	Normals  [][3]float32
	Tints    [][4]uint8
	UVs      [][2]float32
	UV2s     [][2]float32
	Faces    []*EQFace
	// contains filtered or unexported fields
}

ModDef is an entry EQMODELDEF

func (*ModDef) Definition added in v1.4.203

func (e *ModDef) Definition() string

func (*ModDef) FromRaw added in v1.4.203

func (e *ModDef) FromRaw(wce *Wce, src *raw.Mod) error

func (*ModDef) Read added in v1.4.203

func (e *ModDef) Read(token *AsciiReadToken) error

func (*ModDef) ToRaw added in v1.4.203

func (e *ModDef) ToRaw(wce *Wce, dst *raw.Mod) error

func (*ModDef) Write added in v1.4.203

func (e *ModDef) Write(token *AsciiWriteToken) error

type NullFloat32

type NullFloat32 struct {
	Float32 float32
	Valid   bool
}

type NullFloat32Slice3

type NullFloat32Slice3 struct {
	Float32Slice3 [3]float32
	Valid         bool
}

type NullFloat32Slice4

type NullFloat32Slice4 struct {
	Float32Slice4 [4]float32
	Valid         bool
}

type NullFloat32Slice6

type NullFloat32Slice6 struct {
	Float32Slice6 [6]float32
	Valid         bool
}

type NullFloat64

type NullFloat64 sql.NullFloat64

type NullInt16

type NullInt16 sql.NullInt16

type NullInt16Slice3

type NullInt16Slice3 struct {
	Int16Slice3 [3]int16
	Valid       bool
}

type NullInt32

type NullInt32 sql.NullInt32

type NullInt64

type NullInt64 sql.NullInt64

type NullInt8

type NullInt8 struct {
	Int8  int8
	Valid bool
}

type NullString

type NullString sql.NullString

type NullUint16

type NullUint16 struct {
	Uint16 uint16
	Valid  bool
}

type NullUint32

type NullUint32 struct {
	Uint32 uint32
	Valid  bool
}

type NullUint64

type NullUint64 struct {
	Uint64 uint64
	Valid  bool
}

type NullUint8

type NullUint8 struct {
	Uint8 uint8
	Valid bool
}

type Obstacle

type Obstacle struct {
	Normal   [4]float32
	Vertices [][3]float32
}

type ParticleCloudDef

type ParticleCloudDef struct {
	Tag                   string
	BlitSpriteDefTag      string
	SettingOne            uint32
	SettingTwo            uint32
	Movement              string
	HighOpacity           int
	FollowItem            int
	SimultaneousParticles uint32
	UnkSix                uint32
	UnkSeven              uint32
	UnkEight              uint32
	UnkNine               uint32
	UnkTen                uint32
	SpawnRadius           float32
	SpawnAngle            float32
	SpawnLifespan         uint32
	SpawnVelocity         float32
	SpawnNormal           [3]float32
	SpawnRate             uint32
	SpawnScale            float32
	Color                 [4]uint8
	HexEightyFlag         int
	HexOneHundredFlag     int
	HexFourHundredFlag    int
	HexFourThousandFlag   int
	HexEightThousandFlag  int
	HexTenThousandFlag    int
	HexTwentyThousandFlag int
	// contains filtered or unexported fields
}

func (*ParticleCloudDef) Definition

func (e *ParticleCloudDef) Definition() string

func (*ParticleCloudDef) FromRaw

func (e *ParticleCloudDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragParticleCloudDef) error

func (*ParticleCloudDef) Read

func (e *ParticleCloudDef) Read(token *AsciiReadToken) error

func (*ParticleCloudDef) ToRaw

func (e *ParticleCloudDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*ParticleCloudDef) Write

func (e *ParticleCloudDef) Write(token *AsciiWriteToken) error

type PointLight

type PointLight struct {
	Tag             string
	LightDefTag     string
	Static          int
	StaticInfluence int
	HasRegions      int
	LightFlags      uint32
	Flags           uint32
	Location        [3]float32
	Radius          float32
	// contains filtered or unexported fields
}

PointLight is a declaration of POINTLIGHT

func (*PointLight) Definition

func (e *PointLight) Definition() string

func (*PointLight) FromRaw

func (e *PointLight) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragPointLight) error

func (*PointLight) Read

func (e *PointLight) Read(token *AsciiReadToken) error

func (*PointLight) ToRaw

func (e *PointLight) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*PointLight) Write

func (e *PointLight) Write(token *AsciiWriteToken) error

type PolyhedronDefinition

type PolyhedronDefinition struct {
	Tag            string
	BoundingRadius float32
	ScaleFactor    float32
	Vertices       [][3]float32
	Faces          [][]uint32
	HexOneFlag     int
	// contains filtered or unexported fields
}

func (*PolyhedronDefinition) Definition

func (e *PolyhedronDefinition) Definition() string

func (*PolyhedronDefinition) FromRaw

func (e *PolyhedronDefinition) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragPolyhedronDef) error

func (*PolyhedronDefinition) Read

func (e *PolyhedronDefinition) Read(token *AsciiReadToken) error

func (*PolyhedronDefinition) ToRaw

func (e *PolyhedronDefinition) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*PolyhedronDefinition) Write

func (e *PolyhedronDefinition) Write(token *AsciiWriteToken) error

type PolyhedronDefinitionFace

type PolyhedronDefinitionFace struct {
	Vertices []uint32
}

type PropOpt

type PropOpt struct {
	Name string
	Min  int
}

type RGBTrackDef

type RGBTrackDef struct {
	Tag   string
	Data1 uint32
	Data2 uint32
	Data4 uint32
	Sleep uint32
	RGBAs [][4]uint8
	// contains filtered or unexported fields
}

func (*RGBTrackDef) Definition

func (e *RGBTrackDef) Definition() string

func (*RGBTrackDef) FromRaw

func (e *RGBTrackDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragDmRGBTrackDef) error

func (*RGBTrackDef) Read

func (e *RGBTrackDef) Read(token *AsciiReadToken) error

func (*RGBTrackDef) ToRaw

func (e *RGBTrackDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*RGBTrackDef) Write

func (e *RGBTrackDef) Write(token *AsciiWriteToken) error

type Region

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

func (e *Region) Definition() string

func (*Region) FromRaw

func (e *Region) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragRegion) error

func (*Region) Read

func (e *Region) Read(token *AsciiReadToken) error

func (*Region) ToRaw

func (e *Region) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*Region) Write

func (e *Region) Write(token *AsciiWriteToken) error

type SimpleSpriteDef

type SimpleSpriteDef struct {
	Tag                string
	Variation          int
	SkipFrames         NullUint32
	Sleep              NullUint32
	CurrentFrame       NullInt32
	Animated           NullUint32
	SimpleSpriteFrames []SimpleSpriteFrame
	// contains filtered or unexported fields
}

SimpleSpriteDef is a declaration of SIMPLESPRITEDEF

func (*SimpleSpriteDef) Definition

func (e *SimpleSpriteDef) Definition() string

func (*SimpleSpriteDef) FromRaw

func (e *SimpleSpriteDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragSimpleSpriteDef) error

func (*SimpleSpriteDef) Read

func (e *SimpleSpriteDef) Read(token *AsciiReadToken) error

func (*SimpleSpriteDef) ToRaw

func (e *SimpleSpriteDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*SimpleSpriteDef) Write

func (e *SimpleSpriteDef) Write(token *AsciiWriteToken) error

type SimpleSpriteFrame

type SimpleSpriteFrame struct {
	TextureFile string
	TextureTag  string
}

type Sprite2DDef

type Sprite2DDef struct {
	Tag             string
	Scale           [2]float32
	SphereListTag   string
	DepthScale      float32
	CenterOffset    [3]float32
	BoundingRadius  float32
	CurrentFrameRef int32
	Sleep           uint32
	Headings        []uint32
	RenderMethod    string
	Pen             NullUint32
	Brightness      NullFloat32
	ScaledAmbient   NullFloat32
	SpriteTag       NullString
	UvOrigin        NullFloat32Slice3
	UAxis           NullFloat32Slice3
	VAxis           NullFloat32Slice3
	Uvs             [][2]float32
	TwoSided        int
	// contains filtered or unexported fields
}

func (*Sprite2DDef) Definition

func (e *Sprite2DDef) Definition() string

func (*Sprite2DDef) FromRaw

func (e *Sprite2DDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragSprite2DDef) error

func (*Sprite2DDef) Read

func (e *Sprite2DDef) Read(token *AsciiReadToken) error

func (*Sprite2DDef) ToRaw

func (e *Sprite2DDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*Sprite2DDef) Write

func (e *Sprite2DDef) Write(token *AsciiWriteToken) error

type Sprite3DDef

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

func (e *Sprite3DDef) Definition() string

func (*Sprite3DDef) FromRaw

func (e *Sprite3DDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragSprite3DDef) error

func (*Sprite3DDef) Read

func (s *Sprite3DDef) Read(token *AsciiReadToken) error

func (*Sprite3DDef) ToRaw

func (e *Sprite3DDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*Sprite3DDef) Write

func (e *Sprite3DDef) Write(token *AsciiWriteToken) error

type TerDef added in v1.4.203

type TerDef struct {
	Tag      string
	Version  uint32
	Vertices [][3]float32
	Normals  [][3]float32
	Tints    [][4]uint8
	UVs      [][2]float32
	UV2s     [][2]float32
	Faces    []*EQFace
	// contains filtered or unexported fields
}

TerDef is an entry EQTERRAINDEF

func (*TerDef) Definition added in v1.4.203

func (e *TerDef) Definition() string

func (*TerDef) FromRaw added in v1.4.203

func (e *TerDef) FromRaw(wce *Wce, src *raw.Ter) error

func (*TerDef) Read added in v1.4.203

func (e *TerDef) Read(token *AsciiReadToken) error

func (*TerDef) ToRaw added in v1.4.203

func (e *TerDef) ToRaw(wce *Wce, dst *raw.Ter) error

func (*TerDef) Write added in v1.4.203

func (e *TerDef) Write(token *AsciiWriteToken) error

type TrackDef

type TrackDef struct {
	Tag          string
	TagIndex     int
	SpriteTag    string
	Frames       []*Frame
	LegacyFrames []*LegacyFrame
	// contains filtered or unexported fields
}

func (*TrackDef) Definition

func (e *TrackDef) Definition() string

func (*TrackDef) FromRaw

func (e *TrackDef) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragTrackDef) error

func (*TrackDef) Read

func (e *TrackDef) Read(token *AsciiReadToken) error

func (*TrackDef) ToRaw

func (e *TrackDef) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*TrackDef) Write

func (e *TrackDef) Write(token *AsciiWriteToken) error

type TrackInstance

type TrackInstance struct {
	Tag                string
	TagIndex           int
	SpriteTag          string
	DefinitionTag      string
	DefinitionTagIndex int
	Interpolate        int
	Reverse            int
	Sleep              NullUint32
	// contains filtered or unexported fields
}

func (*TrackInstance) Definition

func (e *TrackInstance) Definition() string

func (*TrackInstance) FromRaw

func (e *TrackInstance) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragTrack) error

func (*TrackInstance) Read

func (e *TrackInstance) Read(token *AsciiReadToken) error

func (*TrackInstance) ToRaw

func (e *TrackInstance) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*TrackInstance) Write

func (e *TrackInstance) Write(token *AsciiWriteToken) error

type VisList

type VisList struct {
	Ranges []byte
}

type VisNode

type VisNode struct {
	Normal       [4]float32
	VisListIndex uint32
	FrontTree    uint32
	BackTree     uint32
}

type VisTree

type VisTree struct {
	VisNodes []*VisNode
	VisLists []*VisList
}

type Wall

type Wall struct {
	Normal   [4]float32
	Vertices [][3]float32
}

type Wce

type Wce struct {
	FileName               string
	WorldDef               *WorldDef
	GlobalAmbientLightDef  *GlobalAmbientLightDef
	Version                uint32
	ActorDefs              []*ActorDef
	ActorInsts             []*ActorInst
	AmbientLights          []*AmbientLight
	BlitSpriteDefs         []*BlitSpriteDef
	DMSpriteDef2s          []*DMSpriteDef2
	DMSpriteDefs           []*DMSpriteDef
	DMTrackDef2s           []*DMTrackDef2
	HierarchicalSpriteDefs []*HierarchicalSpriteDef
	LightDefs              []*LightDef
	MaterialDefs           []*MaterialDef
	MaterialPalettes       []*MaterialPalette
	ParticleCloudDefs      []*ParticleCloudDef
	PointLights            []*PointLight
	PolyhedronDefs         []*PolyhedronDefinition
	Regions                []*Region
	RGBTrackDefs           []*RGBTrackDef
	SimpleSpriteDefs       []*SimpleSpriteDef
	Sprite2DDefs           []*Sprite2DDef
	Sprite3DDefs           []*Sprite3DDef
	TrackDefs              []*TrackDef
	TrackInstances         []*TrackInstance

	WorldTrees     []*WorldTree
	Zones          []*Zone
	MdsDefs        []*MdsDef
	ModDefs        []*ModDef
	TerDefs        []*TerDef
	EQMaterialDefs []*EQMaterialDef
	// contains filtered or unexported fields
}

Wce is a struct representing a Wce file

func New added in v1.4.203

func New(filename string) *Wce

func (*Wce) ByTag

func (wce *Wce) ByTag(tag string) WldDefinitioner

ByTag returns a instance by tag

func (*Wce) ByTagWithIndex

func (wce *Wce) ByTagWithIndex(tag string, index int) WldDefinitioner

ByTagWithIndex returns a instance by tag with index included

func (*Wce) NextTagIndex

func (wce *Wce) NextTagIndex(tag string) int

NextTagIndex returns the next available index for a tag

func (*Wce) ReadAscii

func (wce *Wce) ReadAscii(path string) error

ReadAscii reads the ascii file at path

func (*Wce) ReadEqgRaw added in v1.4.203

func (wce *Wce) ReadEqgRaw(src raw.Reader) error

func (*Wce) ReadWldRaw added in v1.4.203

func (wce *Wce) ReadWldRaw(src *raw.Wld) error

func (*Wce) WriteAscii

func (wce *Wce) WriteAscii(path string) error

func (*Wce) WriteEqgRaw added in v1.4.203

func (wce *Wce) WriteEqgRaw(w io.Writer) error

func (*Wce) WriteWldRaw added in v1.4.203

func (wce *Wce) WriteWldRaw(w io.Writer) error

type WldDefinitioner

type WldDefinitioner interface {
	Definition() string
	ToRaw(src *Wce, dst *raw.Wld) (int16, error)
	Write(token *AsciiWriteToken) error
}

type WorldDef

type WorldDef struct {
	NewWorld   int
	Zone       int
	EqgVersion NullInt8
}

WorldDef stores data about the world itself

func (*WorldDef) Definition

func (e *WorldDef) Definition() string

Definition returns the definition of the WorldDef

func (*WorldDef) Read

func (e *WorldDef) Read(token *AsciiReadToken) error

Read reads the WorldDef from the reader

func (*WorldDef) Write

func (e *WorldDef) Write(token *AsciiWriteToken) error

Write writes the WorldDef to the writer

type WorldNode

type WorldNode struct {
	Normals        [4]float32
	WorldRegionTag string
	FrontTree      uint32
	BackTree       uint32
	Distance       float32
}

type WorldTree

type WorldTree struct {
	Tag        string
	WorldNodes []*WorldNode
	// contains filtered or unexported fields
}

func (*WorldTree) Definition

func (e *WorldTree) Definition() string

func (*WorldTree) FromRaw

func (e *WorldTree) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragWorldTree) error

func (*WorldTree) Read

func (e *WorldTree) Read(token *AsciiReadToken) error

func (*WorldTree) ToRaw

func (e *WorldTree) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*WorldTree) Write

func (e *WorldTree) Write(token *AsciiWriteToken) error

type Zone

type Zone struct {
	Tag      string
	Regions  []uint32
	UserData string
	// contains filtered or unexported fields
}

func (*Zone) Definition

func (e *Zone) Definition() string

func (*Zone) FromRaw

func (e *Zone) FromRaw(wce *Wce, rawWld *raw.Wld, frag *rawfrag.WldFragZone) error

func (*Zone) Read

func (e *Zone) Read(token *AsciiReadToken) error

func (*Zone) ToRaw

func (e *Zone) ToRaw(wce *Wce, rawWld *raw.Wld) (int16, error)

func (*Zone) Write

func (e *Zone) Write(token *AsciiWriteToken) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL