Documentation ¶
Index ¶
- Constants
- type Area
- type AreaPortal
- type Brush
- type BrushModel
- type BrushSide
- type Color32
- type ColorRGBExp32
- type CompressedLightCube
- type Contents
- type Cubemap
- type DetailProp
- type DetailPropInfo
- type DetailPropLighting
- type DetailPropOrientation
- type DetailPropType
- type DetailSprite
- type DispCornerNeighbors
- type DispInfo
- type DispMultiBlend
- type DispNeighbor
- type DispSubNeighbor
- type DispTri
- type DispTriFlags
- type DispVert
- type EPair
- type Edge
- type Entity
- type Face
- type FaceID
- type File
- type Leaf
- type LeafAmbientIndex
- type LeafAmbientLighting
- type LeafWaterData
- type LevelFlags
- type LightingInfo
- type MapFlags
- type NeighborCorner
- type NeighborEdge
- type NeighborOrientation
- type NeighborSpan
- type Node
- type Occluder
- type OccluderPoly
- type OcclusionInfo
- type Overlay
- type OverlayFade
- type OverlaySystemLevel
- type Plane
- type PlaneType
- type PotentialVisibilityInfo
- type PrimVert
- type Primitive
- type PrimitiveType
- type QAngle
- type Solid
- type StaticProp
- type StaticPropFlags
- type StaticPropInfo
- type Surf
- type SurfEdge
- type TexData
- type TexInfo
- type Vector
- type Vector2D
- type Vector4D
- type Vertex
- type VisClusterOffsets
- type WaterOverlay
- type WorldLight
Constants ¶
View Source
const ( MaskAll = ^Contents(0) MaskSolid = ContentsSolid | ContentsMoveable | ContentsWindow | ContentsMonster | ContentsGrate MaskPlayerSolid = MaskSolid | ContentsPlayerClip MaskNPCSolid = MaskSolid | ContentsMonsterClip MaskNPCFluid = MaskNPCSolid &^ ContentsGrate MaskWater = ContentsWater | ContentsMoveable | ContentsSlime MaskOpaque = ContentsSolid | ContentsMoveable | ContentsOpaque MaskOpaqueAndNPCs = MaskOpaque | ContentsMonster MaskBlockLOS = ContentsSolid | ContentsMoveable | ContentsBlockLOS MaskBlockLOSAndNPCs = MaskBlockLOS | ContentsMonster MaskVisible = MaskOpaque | ContentsIgnoreNoDrawOpaque MaskVisibleAndNPCs = MaskOpaqueAndNPCs | ContentsIgnoreNoDrawOpaque MaskShot = ContentsSolid | ContentsMoveable | ContentsMonster | ContentsWindow | ContentsDebris | ContentsHitbox MaskShotBrushOnly = ContentsSolid | ContentsMoveable | ContentsWindow | ContentsDebris MaskShotHull = ContentsSolid | ContentsMoveable | ContentsMonster | ContentsWindow | ContentsDebris | ContentsGrate MaskShotPortal = ContentsSolid | ContentsMoveable | ContentsWindow | ContentsMonster MaskSolidBrushOnly = ContentsSolid | ContentsMoveable | ContentsWindow | ContentsGrate MaskPlayerSolidBrushOnly = MaskSolidBrushOnly | ContentsPlayerClip MaskNPCSolidBrushOnly = MaskSolidBrushOnly | ContentsMonsterClip MaskNPCWorldStatic = ContentsSolid | ContentsWindow | ContentsMonsterClip | ContentsGrate MaskNPCWorldStaticFluid = ContentsSolid | ContentsWindow | ContentsMonsterClip MaskSplitAreaPortal = ContentsWater | ContentsSlime )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AreaPortal ¶
type AreaPortal struct { PortalKey uint16 // Entities have a key called portalnumber (and in vbsp a variable called areaportalnum) which is used to bind them to the area portals by comparing with this value. OtherArea uint16 // The area this portal looks into. FirstClipPortalVert uint16 // Portal geometry. NumClipPortalVerts uint16 PlaneNum int32 }
type BrushModel ¶
type ColorRGBExp32 ¶
type CompressedLightCube ¶
type CompressedLightCube struct {
Color [6]ColorRGBExp32
}
type Contents ¶
type Contents uint32
const ( ContentsEmpty Contents = 0 ContentsSolid Contents = 0x1 ContentsWindow Contents = 0x2 ContentsAux Contents = 0x4 ContentsGrate Contents = 0x8 ContentsSlime Contents = 0x10 ContentsWater Contents = 0x20 ContentsBlockLOS Contents = 0x40 ContentsOpaque Contents = 0x80 ContentsTestFogVolume Contents = 0x100 ContentsTeam1 Contents = 0x800 ContentsTeam2 Contents = 0x1000 ContentsIgnoreNoDrawOpaque Contents = 0x2000 ContentsMoveable Contents = 0x4000 ContentsAreaPortal Contents = 0x8000 ContentsPlayerClip Contents = 0x10000 ContentsMonsterClip Contents = 0x20000 ContentsCurrent0 Contents = 0x40000 ContentsCurrent90 Contents = 0x80000 ContentsCurrent180 Contents = 0x100000 ContentsCurrent270 Contents = 0x200000 ContentsCurrentUp Contents = 0x400000 ContentsCurrentDown Contents = 0x800000 ContentsOrigin Contents = 0x1000000 ContentsMonster Contents = 0x2000000 ContentsDebris Contents = 0x4000000 ContentsDetail Contents = 0x8000000 ContentsTransluscent Contents = 0x10000000 ContentsLadder Contents = 0x20000000 ContentsHitbox Contents = 0x40000000 )
type DetailProp ¶
type DetailProp struct { Origin Vector Angles QAngle DetailModel uint16 // either index into Names or Sprites Leaf uint16 Lighting ColorRGBExp32 LightStyles uint32 LightStyleCount uint8 SwayAmount uint8 // how much do the details sway ShapeAngle uint8 // angle param for shaped sprites ShapeSize uint8 // size param for shaped sprites Orientation DetailPropOrientation Padding2 [3]byte Type DetailPropType Padding3 [3]byte Scale float32 // For sprites only currently }
type DetailPropInfo ¶
type DetailPropInfo struct { Names []string Sprites []DetailSprite Props []DetailProp }
type DetailPropLighting ¶
type DetailPropLighting struct { Lighting ColorRGBExp32 Style uint8 }
type DetailPropOrientation ¶
type DetailPropOrientation uint8
const ( OrientNormal DetailPropOrientation = 0 OrientScreenAligned DetailPropOrientation = 1 OrientScreenAlignedVertical DetailPropOrientation = 2 )
type DetailPropType ¶
type DetailPropType uint8
const ( DetailPropTypeModel DetailPropType = 0 DetailPropTypeSprite DetailPropType = 1 DetailPropTypeShapeCross DetailPropType = 2 DetailPropTypeShapeTri DetailPropType = 3 )
type DetailSprite ¶
type DispCornerNeighbors ¶
type DispInfo ¶
type DispInfo struct { StartPosition Vector // start position used for orientation -- (added BSPVERSION 6) DispVertStart int32 // Index into DispVerts. DispTriStart int32 // Index into DispTris. Power int32 // power - indicates size of map (2^power + 1) MinTess int32 // minimum tesselation allowed SmoothingAngle float32 // lighting smoothing angle Contents Contents // surface contents MapFace uint16 // Which map face this displacement comes from. Padding [2]byte LightmapAlphaStart int32 // Index into ddisplightmapalpha. The count is m_pParent->lightmapTextureSizeInLuxels[0]*m_pParent->lightmapTextureSizeInLuxels[1]. LightmapSamplePositionStart int32 // Index into DispLightmapSamplePositions. EdgeNeighbors [4]DispNeighbor // Indexed by NeighborEdge enum. CornerNeighbors [4]DispCornerNeighbors // Indexed by NeighborCorner enum. AllowedVerts [10]uint32 // This is built based on the layout and sizes of our neighbors and tells us which vertices are allowed to be active. }
type DispMultiBlend ¶
type DispNeighbor ¶
type DispNeighbor struct {
SubNeighbors [2]DispSubNeighbor
}
type DispSubNeighbor ¶
type DispSubNeighbor struct { Neighbor uint16 // This indexes into DispInfo. 0xFFFF if there is no neighbor here. NeighborOrientation NeighborOrientation // (CCW) rotation of the neighbor wrt this displacement. Span NeighborSpan // Where the neighbor fits onto this side of our displacement. NeighborSpan NeighborSpan // Where we fit onto our neighbor. Padding [1]byte }
type DispTri ¶
type DispTri struct {
Flags DispTriFlags
}
type DispTriFlags ¶
type DispTriFlags uint16
const ( DispTriFlagSurface DispTriFlags = 0x1 DispTriFlagWalkable DispTriFlags = 0x2 DispTriFlagBuildable DispTriFlags = 0x4 DispTriFlagSurfProp1 DispTriFlags = 0x8 DispTriFlagSurfProp2 DispTriFlags = 0x10 DispTriFlagSurfProp3 DispTriFlags = 0x20 DispTriFlagSurfProp4 DispTriFlags = 0x40 )
type Face ¶
type Face struct { PlaneNum uint16 Side uint8 // faces opposite to the node's plane direction OnNode uint8 // 1 of on node, 0 if in leaf FirstEdge int32 // we must support > 64k edges NumEdges int16 TexInfo int16 DispInfo int16 SurfaceFogVolumeID int16 Styles [4]uint8 LightOfs int32 // start of [numstyles*surfsize] samples Area float32 LightmapTextureMinsInLuxels [2]int32 LightmapTextureSizeInLuxels [2]int32 OrigFace int32 // reference the original face this face was derived from NumPrims uint16 // Top bit, if set, disables shadows on this surface FirstPrimID uint16 SmoothingGroups uint32 }
type File ¶
type File struct { Entities []Entity PakFile *zip.Reader Flags MapFlags // world geometry Planes []Plane Vertexes []Vertex FaceIDs []FaceID Edges []Edge SurfEdges []SurfEdge BrushModels []BrushModel Brushes []Brush BrushSides []BrushSide OriginalFaces []Face VertNormals []Vector VertNormalIndices []uint16 Primitives []Primitive PrimVerts []PrimVert PrimIndices []uint16 Overlays []Overlay WaterOverlays []WaterOverlay OverlayFades []OverlayFade OverlaySystemLevels []OverlaySystemLevel // displacements DispInfo []DispInfo DispVerts []DispVert DispLightmapSamplePositions []byte DispTris []DispTri DispMultiBlend []DispMultiBlend PhysDisp [][]byte // texture data TexData []TexData TexInfo []TexInfo Cubemaps []Cubemap TexNames []string FaceTextureID []uint16 // visibility data PV PotentialVisibilityInfo Occlusion OcclusionInfo Nodes []Node Leafs []Leaf LeafFaces []uint16 LeafBrushes []uint16 Areas []Area AreaPortals []AreaPortal LeafWaterData []LeafWaterData ClipPortalVerts []Vector LeafMinDistToWater []uint16 // lighting data LDR LightingInfo HDR LightingInfo // props StaticProps StaticPropInfo DetailProps DetailPropInfo }
type Leaf ¶
type Leaf struct { Contents Contents Cluster int16 AreaFlags uint16 // top 9 bits area bottom 7 bits flags Mins [3]int16 // for frustum culling Maxs [3]int16 FirstLeafFace uint16 NumLeafFaces uint16 FirstLeafBrush uint16 NumLeafBrushes uint16 LeafWaterDataID int16 // -1 for not in water Padding [2]byte }
type LeafAmbientIndex ¶
type LeafAmbientLighting ¶
type LeafAmbientLighting struct { Cube CompressedLightCube X, Y, Z uint8 // fixed point fraction of leaf bounds Reserved byte }
each leaf contains N samples of the ambient lighting each sample contains a cube of ambient light projected on to each axis and a sampling position encoded as a 0.8 fraction (mins=0,maxs=255) of the leaf's bounding box
type LeafWaterData ¶
type LevelFlags ¶
type LevelFlags uint32
const ( LevelFlagsBakedStaticPropLightingNonHDR LevelFlags = 0x00000001 // was processed by vrad with -staticproplighting, no hdr data LevelFlagsBakedStaticPropLightingHDR LevelFlags = 0x00000002 // was processed by vrad with -staticproplighting, in hdr )
type LightingInfo ¶
type LightingInfo struct { Faces []Face Lighting []ColorRGBExp32 WorldLights []WorldLight LeafAmbientIndex []LeafAmbientIndex LeafAmbientLighting []LeafAmbientLighting DetailPropLighting []DetailPropLighting }
type MapFlags ¶
type MapFlags struct {
Level LevelFlags
}
type NeighborCorner ¶
type NeighborCorner uint8
const ( NeighborCornerLowerLeft NeighborCorner = 0 NeighborCornerUpperLeft NeighborCorner = 1 NeighborCornerUpperRight NeighborCorner = 2 NeighborCornerLowerRight NeighborCorner = 3 )
type NeighborEdge ¶
type NeighborEdge uint8
const ( NeighborEdgeLeft NeighborEdge = 0 NeighborEdgeTop NeighborEdge = 1 NeighborEdgeRight NeighborEdge = 2 NeighborEdgeBottom NeighborEdge = 3 )
type NeighborOrientation ¶
type NeighborOrientation uint8
const ( OrientationCCW0 NeighborOrientation = 0 OrientationCCW90 NeighborOrientation = 1 OrientationCCW180 NeighborOrientation = 2 OrientationCCW270 NeighborOrientation = 3 )
type NeighborSpan ¶
type NeighborSpan uint8
const ( CornerToCorner NeighborSpan = 0 CornerToMidpoint NeighborSpan = 1 MidpointToCorner NeighborSpan = 2 )
type Node ¶
type Node struct { PlaneNum int32 Children [2]int32 // negative numbers are -(leafs+1), not nodes Mins [3]int16 // for frustum culling Maxs [3]int16 FirstFace uint16 NumFaces uint16 // counting both sides Area int16 // If all leaves below this node are in the same area, then this is the area index. If not, this is -1. Padding [2]byte }
type OccluderPoly ¶
type OcclusionInfo ¶
type OcclusionInfo struct { Occluders []Occluder Polys []OccluderPoly VertIndices []int32 }
type OverlayFade ¶
type OverlaySystemLevel ¶
type PotentialVisibilityInfo ¶
type PotentialVisibilityInfo struct { Clusters []VisClusterOffsets Bits []byte }
type PrimitiveType ¶
type PrimitiveType uint8
const ( PrimTriList PrimitiveType = 0 PrimTriStrip PrimitiveType = 1 )
type StaticProp ¶
type StaticProp struct { Origin Vector Angles QAngle PropType uint16 FirstLeaf uint16 LeafCount uint16 Solid Solid Flags StaticPropFlags Skin int32 FadeMinDist float32 FadeMaxDist float32 LightingOrigin Vector ForcedFadeScale float32 MinCPULevel uint8 MaxCPULevel uint8 MinGPULevel uint8 MaxGPULevel uint8 DiffuseModulation Color32 // per instance color and alpha modulation DisableX360 bool Padding [3]byte }
type StaticPropFlags ¶
type StaticPropFlags uint8
const ( StaticPropFades StaticPropFlags = 0x1 StaticPropUseLightingOrigin StaticPropFlags = 0x2 StaticPropNoDraw StaticPropFlags = 0x4 SttaicPropIgnoreNormals StaticPropFlags = 0x8 StaticPropNoShadow StaticPropFlags = 0x10 StaticPropNoVertexLighting StaticPropFlags = 0x40 StaticPropNoSelfShadowing StaticPropFlags = 0x80 )
type StaticPropInfo ¶
type StaticPropInfo struct { Names []string LeafIDs []uint16 Props []StaticProp }
type Surf ¶
type Surf uint16
const ( SurfLight Surf = 0x0001 SurfSky2D Surf = 0x0002 SurfSky Surf = 0x0004 SurfWarp Surf = 0x0008 SurfTrans Surf = 0x0010 SurfNoPortal Surf = 0x0020 SurfTrigger Surf = 0x0040 SurfNoDraw Surf = 0x0080 SurfHint Surf = 0x0100 SurfSkip Surf = 0x0200 SurfNoLight Surf = 0x0400 SurfBumpLight Surf = 0x0800 SurfNoShadows Surf = 0x1000 SurfNoDecals Surf = 0x2000 SurfNoChop Surf = 0x4000 SurfHitbox Surf = 0x8000 )
type SurfEdge ¶
type SurfEdge struct { // positive refers to Edges[Edge].Vertex[0], // negative to Edges[-Edge].Vertex[1]. Edge int32 }
type VisClusterOffsets ¶
type WaterOverlay ¶
type WorldLight ¶
type WorldLight struct { Origin Vector Intensity Vector Normal Vector // for surfaces and spotlights ShadowCastOffset Vector // gets added to the light origin when this light is used as a shadow caster (only if DWL_FLAGS_CASTENTITYSHADOWS flag is set) Cluster int32 // 0 = emit_surface, 90 degree spotlight // 1 = emit_point, simple point light source // 2 = emit_spotlight, spotlight with penumbra // 3 = emit_skylight, directional light with no falloff (surface must trace to SKY texture) // 4 = emit_quakelight, linear falloff, non-lambertian // 5 = emit_skyambient, spherical light source with no falloff (surface must trace to SKY texture) Type int32 Style int32 StopDot float32 // start of penumbra for emit_spotlight StopDot2 float32 // end of penumbra for emit_spotlight Exponent float32 Radius float32 // cutoff distance // falloff for emit_spotlight + emit_point: // 1 / (ConstantAttn + LinearAttn * dist + QuadraticAttn * dist^2) ConstantAttn float32 LinearAttn float32 QuadraticAttn float32 Flags int32 // Uses a combination of the DWL_FLAGS_ defines. TexInfo int32 Owner int32 // entity that this light is relative to }
Click to show internal directories.
Click to hide internal directories.