C# Class OpenMetaverse.AppearanceManager

Afficher le fichier Open project: N3X15/VoxelSim Class Usage Examples

Méthodes publiques

Свойство Type Description
BAKED_TEXTURE_HASH UUID[]
BakeIndexToTextureIndex byte[]
DEFAULT_AVATAR_TEXTURE UUID
WEARABLE_BAKE_MAP WearableType[][]

Méthodes publiques

Méthode Description
AddAttachments ( List attachments, bool removeExistingFirst ) : void

Adds a list of attachments to our agent

AddToOutfit ( InventoryItem wearableItem ) : void

Add a wearable to the current outfit and set appearance

AddToOutfit ( List wearableItems ) : void

Add a list of wearables to the current outfit and set appearance

AppearanceManager ( GridClient client ) : System

Default constructor

Attach ( InventoryItem item, AttachmentPoint attachPoint ) : void

Attach an item to our agent at a specific attach point

Attach ( UUID itemID, UUID ownerID, string name, string description, Permissions perms, uint itemFlags, AttachmentPoint attachPoint ) : void

Attach an item to our agent specifying attachment details

BakeTypeToAgentTextureIndex ( BakeType index ) : AvatarTextureIndex

Converts a BakeType to the corresponding baked texture slot in AvatarTextureIndex

BakeTypeToTextures ( BakeType bakeType ) : List

Converts a BakeType to a list of the texture slots that make up that bake

Detach ( InventoryItem item ) : void

Detach an item from our agent using an OpenMetaverse.InventoryItem object

Detach ( UUID itemID ) : void

Detach an item from our agent

GetWearableAsset ( WearableType type ) : UUID

Returns the AssetID of the asset that is currently being worn in a given WearableType slot

GetWearables ( ) : WearableData>.Dictionary

Returns a copy of the agents currently worn wearables

Avoid calling this function multiple times as it will make a copy of all of the wearable data each time

IsItemWorn ( InventoryItem item ) : WearableType

Checks if an inventory item is currently being worn

MorphLayerForBakeType ( BakeType bakeType ) : AvatarTextureIndex

Gives the layer number that is used for morph mask

RemoveFromOutfit ( InventoryItem wearableItem ) : void

Remove a wearable from the current outfit and set appearance

RemoveFromOutfit ( List wearableItems ) : void

Removes a list of wearables from the current outfit and set appearance

ReplaceOutfit ( List wearableItems ) : void

Replace the current outfit with a list of wearables and set appearance

RequestAgentWearables ( ) : void

Ask the server what textures our agent is currently wearing

RequestCachedBakes ( ) : void

Build hashes out of the texture assetIDs for each baking layer to ask the simulator whether it has cached copies of each baked texture

RequestSetAppearance ( ) : void

Starts the appearance setting thread

RequestSetAppearance ( bool forceRebake ) : void

Starts the appearance setting thread

WearOutfit ( List wearables, bool replaceItems ) : void

Calls either ReplaceOutfit or AddToOutfit depending on the value of replaceItems

WearableTypeToAssetType ( WearableType type ) : AssetType

Converts a WearableType to a bodypart or clothing WearableType

Méthodes protégées

Méthode Description
AgentCachedTextureResponseHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
AgentWearablesUpdateHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
OnAgentCachedBakes ( AgentCachedBakesReplyEventArgs e ) : void

Raises the CachedBakesReply event

OnAgentWearables ( AgentWearablesReplyEventArgs e ) : void

Raises the AgentWearablesReply event

OnAppearanceSet ( AppearanceSetEventArgs e ) : void

Raises the AppearanceSet event

OnRebakeAvatar ( RebakeAvatarTexturesEventArgs e ) : void

Raises the RebakeAvatarRequested event

RebakeAvatarTexturesHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void

Private Methods

Méthode Description
AddTextureDownload ( AvatarTextureIndex index, List textures ) : void

Helper method to lookup the TextureID for a single layer and add it to a list if it is not already present

CreateBake ( BakeType bakeType ) : bool

Blocking method to create and upload a baked texture for a single bake layer

CreateBakes ( ) : bool

Blocking method to create and upload baked textures for all of the missing bakes

DecodeWearableParams ( WearableData wearable ) : void

Populates textures and visual params from a decoded asset

DelayedRequestSetAppearance ( ) : void
DownloadTextures ( List bakeLayers ) : void

Blocking method to download all of the textures needed for baking the given bake layers

No return value is given because the baking will happen whether or not all textures are successfully downloaded

DownloadWearables ( ) : bool

Blocking method to download and parse currently worn wearable assets

GetAgentWearables ( ) : bool

Blocking method to populate the Wearables dictionary

GetCachedBakes ( ) : bool

Blocking method to populate the Textures array with cached bakes

GetColorFromParams ( List param ) : Color4

Calculates base color/tint for a specific wearable based on its params

GetFolderWearables ( UUID folder, List &wearables, List &attachments ) : bool
GetFolderWearables ( string folderPath, List &wearables, List &attachments ) : bool
GetTextureDownloadList ( BakeType bakeType ) : List

Get a list of all of the textures that need to be downloaded for a single bake layer

MakeParamValues ( ) : float>.Dictionary

Creates a dictionary of visual param values from the downloaded wearables

Network_OnDisconnected ( object sender, OpenMetaverse.DisconnectedEventArgs e ) : void
Network_OnEventQueueRunning ( object sender, OpenMetaverse.EventQueueRunningEventArgs e ) : void
RebakeScheduleTimerTick ( Object state ) : void
ReplaceOutfit ( List wearableItems ) : void

Replaces the Wearables collection with a list of new wearable items

RequestAgentSetAppearance ( ) : void

Create an AgentSetAppearance packet from Wearables data and the Textures array and send it

SendAgentIsNowWearing ( ) : void

Inform the sim which wearables are part of our current outfit

SetPreviousAppearance ( ) : void
SetPreviousAppearance ( bool allowBake ) : void
UploadBake ( byte textureData ) : UUID

Blocking method to upload a baked texture

Method Details

AddAttachments() public méthode

Adds a list of attachments to our agent
public AddAttachments ( List attachments, bool removeExistingFirst ) : void
attachments List A List containing the attachments to add
removeExistingFirst bool If true, tells simulator to remove existing attachment /// first
Résultat void

AddToOutfit() public méthode

Add a wearable to the current outfit and set appearance
public AddToOutfit ( InventoryItem wearableItem ) : void
wearableItem InventoryItem Wearable to be added to the outfit
Résultat void

AddToOutfit() public méthode

Add a list of wearables to the current outfit and set appearance
public AddToOutfit ( List wearableItems ) : void
wearableItems List List of wearable inventory items to /// be added to the outfit
Résultat void

AgentCachedTextureResponseHandler() protected méthode

protected AgentCachedTextureResponseHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object
e OpenMetaverse.PacketReceivedEventArgs
Résultat void

AgentWearablesUpdateHandler() protected méthode

protected AgentWearablesUpdateHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object
e OpenMetaverse.PacketReceivedEventArgs
Résultat void

AppearanceManager() public méthode

Default constructor
public AppearanceManager ( GridClient client ) : System
client GridClient A reference to our agent
Résultat System

Attach() public méthode

Attach an item to our agent at a specific attach point
public Attach ( InventoryItem item, AttachmentPoint attachPoint ) : void
item InventoryItem A to attach
attachPoint AttachmentPoint the on the avatar /// to attach the item to
Résultat void

Attach() public méthode

Attach an item to our agent specifying attachment details
public Attach ( UUID itemID, UUID ownerID, string name, string description, Permissions perms, uint itemFlags, AttachmentPoint attachPoint ) : void
itemID UUID The of the item to attach
ownerID UUID The attachments owner
name string The name of the attachment
description string The description of the attahment
perms Permissions The to apply when attached
itemFlags uint The of the attachment
attachPoint AttachmentPoint The on the agent /// to attach the item to
Résultat void

BakeTypeToAgentTextureIndex() public static méthode

Converts a BakeType to the corresponding baked texture slot in AvatarTextureIndex
public static BakeTypeToAgentTextureIndex ( BakeType index ) : AvatarTextureIndex
index BakeType A BakeType
Résultat AvatarTextureIndex

BakeTypeToTextures() public static méthode

Converts a BakeType to a list of the texture slots that make up that bake
public static BakeTypeToTextures ( BakeType bakeType ) : List
bakeType BakeType A BakeType
Résultat List

Detach() public méthode

Detach an item from our agent using an OpenMetaverse.InventoryItem object
public Detach ( InventoryItem item ) : void
item InventoryItem An object
Résultat void

Detach() public méthode

Detach an item from our agent
public Detach ( UUID itemID ) : void
itemID UUID The inventory itemID of the item to detach
Résultat void

GetWearableAsset() public méthode

Returns the AssetID of the asset that is currently being worn in a given WearableType slot
public GetWearableAsset ( WearableType type ) : UUID
type WearableType WearableType slot to get the AssetID for
Résultat UUID

GetWearables() public méthode

Returns a copy of the agents currently worn wearables
Avoid calling this function multiple times as it will make a copy of all of the wearable data each time
public GetWearables ( ) : WearableData>.Dictionary
Résultat WearableData>.Dictionary

IsItemWorn() public méthode

Checks if an inventory item is currently being worn
public IsItemWorn ( InventoryItem item ) : WearableType
item InventoryItem The inventory item to check against the agent /// wearables
Résultat WearableType

MorphLayerForBakeType() public static méthode

Gives the layer number that is used for morph mask
public static MorphLayerForBakeType ( BakeType bakeType ) : AvatarTextureIndex
bakeType BakeType >A BakeType
Résultat AvatarTextureIndex

OnAgentCachedBakes() protected méthode

Raises the CachedBakesReply event
protected OnAgentCachedBakes ( AgentCachedBakesReplyEventArgs e ) : void
e AgentCachedBakesReplyEventArgs An AgentCachedBakesReplyEventArgs object containing the /// data returned from the data server AgentCachedTextureResponse
Résultat void

OnAgentWearables() protected méthode

Raises the AgentWearablesReply event
protected OnAgentWearables ( AgentWearablesReplyEventArgs e ) : void
e AgentWearablesReplyEventArgs An AgentWearablesReplyEventArgs object containing the /// data returned from the data server
Résultat void

OnAppearanceSet() protected méthode

Raises the AppearanceSet event
protected OnAppearanceSet ( AppearanceSetEventArgs e ) : void
e AppearanceSetEventArgs An AppearanceSetEventArgs object indicating if the operatin was successfull
Résultat void

OnRebakeAvatar() protected méthode

Raises the RebakeAvatarRequested event
protected OnRebakeAvatar ( RebakeAvatarTexturesEventArgs e ) : void
e RebakeAvatarTexturesEventArgs An RebakeAvatarTexturesEventArgs object containing the /// data returned from the data server
Résultat void

RebakeAvatarTexturesHandler() protected méthode

protected RebakeAvatarTexturesHandler ( object sender, OpenMetaverse.PacketReceivedEventArgs e ) : void
sender object
e OpenMetaverse.PacketReceivedEventArgs
Résultat void

RemoveFromOutfit() public méthode

Remove a wearable from the current outfit and set appearance
public RemoveFromOutfit ( InventoryItem wearableItem ) : void
wearableItem InventoryItem Wearable to be removed from the outfit
Résultat void

RemoveFromOutfit() public méthode

Removes a list of wearables from the current outfit and set appearance
public RemoveFromOutfit ( List wearableItems ) : void
wearableItems List List of wearable inventory items to /// be removed from the outfit
Résultat void

ReplaceOutfit() public méthode

Replace the current outfit with a list of wearables and set appearance
public ReplaceOutfit ( List wearableItems ) : void
wearableItems List List of wearable inventory items that /// define a new outfit
Résultat void

RequestAgentWearables() public méthode

Ask the server what textures our agent is currently wearing
public RequestAgentWearables ( ) : void
Résultat void

RequestCachedBakes() public méthode

Build hashes out of the texture assetIDs for each baking layer to ask the simulator whether it has cached copies of each baked texture
public RequestCachedBakes ( ) : void
Résultat void

RequestSetAppearance() public méthode

Starts the appearance setting thread
public RequestSetAppearance ( ) : void
Résultat void

RequestSetAppearance() public méthode

Starts the appearance setting thread
public RequestSetAppearance ( bool forceRebake ) : void
forceRebake bool True to force rebaking, otherwise false
Résultat void

WearOutfit() public méthode

Calls either ReplaceOutfit or AddToOutfit depending on the value of replaceItems
public WearOutfit ( List wearables, bool replaceItems ) : void
wearables List List of wearable inventory items to add /// to the outfit or become a new outfit
replaceItems bool True to replace existing items with the /// new list of items, false to add these items to the existing outfit
Résultat void

WearableTypeToAssetType() public static méthode

Converts a WearableType to a bodypart or clothing WearableType
public static WearableTypeToAssetType ( WearableType type ) : AssetType
type WearableType A WearableType
Résultat AssetType

Property Details

BAKED_TEXTURE_HASH public_oe static_oe property

Magic values to finalize the cache check hashes for each bake
public static UUID[] BAKED_TEXTURE_HASH
Résultat UUID[]

BakeIndexToTextureIndex public_oe static_oe property

Mapping between BakeType and AvatarTextureIndex
public static byte[] BakeIndexToTextureIndex
Résultat byte[]

DEFAULT_AVATAR_TEXTURE public_oe static_oe property

Default avatar texture, used to detect when a custom texture is not set for a face
public static UUID DEFAULT_AVATAR_TEXTURE
Résultat UUID

WEARABLE_BAKE_MAP public_oe static_oe property

Map of what wearables are included in each bake
public static WearableType[][] WEARABLE_BAKE_MAP
Résultat WearableType[][]