Exemplo n.º 1
0
void psCharAppearance::ProcessAttach(csRef<iMeshWrapper> meshWrap, csRef<iSpriteCal3DSocket> socket)
{
    if(!socket.IsValid())
        return;
    CS_ASSERT(socket.IsValid());
    
    meshWrap->GetFlags().Set(CS_ENTITY_NODECAL);
    const char* socketName = socket->GetName();

    // Given a socket name of "righthand", we're looking for a key in the form of "socket_righthand"
    csString keyName = "socket_";
    keyName += socketName;

    // Variables for transform to be specified
    float trans_x = 0, trans_y = 0.0, trans_z = 0, rot_x = -PI/2, rot_y = 0, rot_z = 0;
    csRef<iObjectIterator> it = meshWrap->GetFactory()->QueryObject()->GetIterator();

    while ( it->HasNext() )
    {
        csRef<iKeyValuePair> key ( scfQueryInterface<iKeyValuePair> (it->Next()));
        if (key && keyName == key->GetKey())
        {
            sscanf(key->GetValue(),"%f,%f,%f,%f,%f,%f",&trans_x,&trans_y,&trans_z,&rot_x,&rot_y,&rot_z);
        }
    }

    meshWrap->QuerySceneNode()->SetParent( baseMesh->QuerySceneNode ());
    socket->SetMeshWrapper( meshWrap );
    socket->SetTransform( csTransform(csZRotMatrix3(rot_z)*csYRotMatrix3(rot_y)*csXRotMatrix3(rot_x), csVector3(trans_x,trans_y,trans_z)) );

    usedSlots.PushSmart(socketName);
}
Exemplo n.º 2
0
void csTinyXmlNode::RemoveAttribute (const csRef<iDocumentAttribute>& attribute)
{
  TiXmlElement* element = node->ToElement ();
  if (element)
  {
    for (size_t i = 0 ; i < element->GetAttributeCount (); i++)
    {
      TiDocumentAttribute& attrib = element->GetAttribute (i);
      if (strcmp (attribute->GetName(), attrib.Name ()) == 0)
      {
        element->RemoveAttribute(attrib.Name());
      }
    }
  }
}
void pawsTextureManager::AddPawsImage(csRef<iPawsImage> element)
{
    // printf("Adding pawsImage called %s\n", element->GetName() );
    elementList.Put(element->GetName(), element);
}
Exemplo n.º 4
0
void psCharAppearance::ProcessAttach(iMeshFactoryWrapper* factory, iMaterialWrapper* material, const char* meshFactName, csRef<iSpriteCal3DSocket> socket)
{
     csRef<iMeshWrapper> meshWrap = engine->CreateMeshWrapper( factory, meshFactName );

     if(material != NULL)
     {
         meshWrap->GetMeshObject()->SetMaterialWrapper(material);
     }

    ProcessAttach(meshWrap, socket);

    psengine->GetCelClient()->HandleItemEffect(factory->QueryObject()->GetName(), socket->GetMeshWrapper(), false, socket->GetName(), &effectids, &lightids);
}