Crystal Space
Welcome, Guest. Please login or register.
September 23, 2014, 09:55:33 pm

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2051 Topics by 8506 Members
Latest Member: Neron5
* Home Help Search Login Register
+  Crystal Space
|-+  Associate Projects
| |-+  CEL Discussion
| | |-+  Dose every entity has a camera?
« previous next »
Pages: [1] Print
Author Topic: Dose every entity has a camera?  (Read 5833 times)
Hilake
Newbie
*
Posts: 27


View Profile Email
« on: August 11, 2005, 09:51:38 am »

hi!

I use cel for my programe! For example about celtest. I want to add an actor in the world, so I use the function CreatActor(). But when I show it, it changes the first actor's camera to the one which I add.  But I didn't want to that happened. I just want to add an actor and not change the camera. How can I do? How can I show the second actor in my game?

Give me some code for your answer!

Thanks,
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: August 11, 2005, 11:06:12 am »

hi!

I use cel for my programe! For example about celtest. I want to add an actor in the world, so I use the function CreatActor(). But when I show it, it changes the first actor's camera to the one which I add.  But I didn't want to that happened. I just want to add an actor and not change the camera. How can I do? How can I show the second actor in my game?

Give me some code for your answer!

Thanks,

Just make a new version of CreateActor() that doesn't add the camera.

Greetings,
Logged
Hilake
Newbie
*
Posts: 27


View Profile Email
« Reply #2 on: August 12, 2005, 02:20:53 am »

Just make a new version of CreateActor() that doesn't add the camera.

Thanks very much! I had tried it. It's successful.

But there have another problem for me. The problem will display a error like 'Can't find entity 'camera' for action SetCamera!', when I change the entiy's name. In celtest the entity's  name is 'camera', so If the entity's name must be 'camera'? This way, how can I change the entity's name and not get the error?

Another questions:
If the entity have no camera. Then how to set the entity's position and render it in the game world?

« Last Edit: August 12, 2005, 06:17:31 am by Hilake » Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: August 12, 2005, 07:20:22 am »

But there have another problem for me. The problem will display a error like 'Can't find entity 'camera' for action SetCamera!', when I change the entiy's name. In celtest the entity's  name is 'camera', so If the entity's name must be 'camera'? This way, how can I change the entity's name and not get the error?

You have to change the call to SetCamera() too then. i.e. change the name.

Quote
Another questions:
If the entity have no camera. Then how to set the entity's position and render it in the game world?

Use the pcmesh property class for that. Check out the iPcMesh api.

Greetings,
Logged
Hilake
Newbie
*
Posts: 27


View Profile Email
« Reply #4 on: August 12, 2005, 09:51:13 am »


You have to change the call to SetCamera() too then. i.e. change the name.

Quote
Thanks!
Do you mean that I must difine the entity's name to "camera"? But I want change the name, there still the error. How can I do?
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #5 on: August 12, 2005, 09:54:57 am »


You have to change the call to SetCamera() too then. i.e. change the name.

Quote
Thanks!
Do you mean that I must difine the entity's name to "camera"? But I want change the name, there still the error. How can I do?

Huh I don't understand the problem. You can safely change the name of the entity. But you must then change it everywhere that that name is referenced. It is as easy as that. So everywhere there is the name "camera" you must change that to the new name.

Greetings,
Logged
Hilake
Newbie
*
Posts: 27


View Profile Email
« Reply #6 on: August 12, 2005, 11:26:09 am »

Thanks a lot!

But I miss another problem. For example, I create a actor without camera. But I want to show it, so I do it in this way:
Code:
csRef<iPcMesh> pm = CEL_QUERY_PROPCLASS_ENT (entity, iPcMesh);
pm->MoveMesh (sector, csVector3(3,0,0));
pm->Show();
Is there another way to show it? For it so difficulte to get the sector. Or is there anyway to get the sector?

Thanks for your help!

Huh I don't understand the problem. You can safely change the name of the entity. But you must then change it everywhere that that name is referenced. It is as easy as that. So everywhere there is the name "camera" you must change that to the new name.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #7 on: August 12, 2005, 11:41:43 am »

Thanks a lot!

But I miss another problem. For example, I create a actor without camera. But I want to show it, so I do it in this way:
Code:
csRef<iPcMesh> pm = CEL_QUERY_PROPCLASS_ENT (entity, iPcMesh);
pm->MoveMesh (sector, csVector3(3,0,0));
pm->Show();
Is there another way to show it? For it so difficulte to get the sector. Or is there anyway to get the sector?

I don't understand the problem. What's difficult about getting the sector?

Greetings,
Logged
Hilake
Newbie
*
Posts: 27


View Profile Email
« Reply #8 on: August 14, 2005, 03:23:11 am »

Thanks a lot!

But I miss another problem. For example, I create a actor without camera. But I want to show it, so I do it in this way:
Code:
csRef<iPcMesh> pm = CEL_QUERY_PROPCLASS_ENT (entity, iPcMesh);
pm->MoveMesh (sector, csVector3(3,0,0));
pm->Show();
Is there another way to show it? For it so difficulte to get the sector. Or is there anyway to get the sector?

I don't understand the problem. What's difficult about getting the sector?

Greetings,

I must get the 'sector' when I show the entity which has no 'camera'. But I don't know how to get the sector before I show the entity.
Is there antway to show the entity that has no 'camera'?
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #9 on: August 14, 2005, 05:55:30 am »


I must get the 'sector' when I show the entity which has no 'camera'. But I don't know how to get the sector before I show the entity.


Well the sector is whatever you like. It must be a sector defined in your map and then you can use that to position your entity.

Quote
Is there antway to show the entity that has no 'camera'?

Yes, using pcmesh.

Greetings,
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 3.248 seconds with 15 queries.