Contacts
صفحه اصلی پورتال | صفحه اصلی تالار | ثبت نام | اعضاء | گروه ها | جستجو | پرسش و پاسخ | فروشگاه الکترونیکی | خرید پستی بازی های کامپیوتری





صفحه اول انجمنها -> ساخت بازی با نرم افزار 3D Game Studio -> رد نشدن جسم از اجسام
 

ارسال يك موضوع جديد   پاسخ به يك موضوع ديدن موضوع قبلي :: ديدن موضوع بعدي
برو به صفحه قبلي  1, 2

نويسنده
پيغام
مهمان







2 شنبه 15 اسفند 1384 - 08:46
پاسخ بصورت نقل قول
سلام دوستان ...
نقل قول:

دوستان فقط محض اطلاع عرض کنم که اگه کدهاتون رو توی تگ code قرار بدین ، دیگه کدهای شما راست چین نمیشه و خیلی راحت تر خونده میشه...


ممنونم علی آقا از راهنمائی بجا و درستت ... چشم .

و حل مشکل این اتومبیل جادو شده :
ببین دوست من ، اگر در کد بالا دقت کنی ، قطعه زیر را مشاهده خواهی کرد :

كد:

trace_mode = ignore_me + ignore_passable + use_box;


حالا توجه کن به متن راهنمای خود 3DGS در اینباره :

كد:

Through the predefined trace_mode variable or the  mode parameter, the mode for the tracing can be composed by adding several mode flags. Trace_mode must be set immediately before the trace instruction. The following flags are available:

ignore_me - ignores the my entity.
ignore_you - ignores the you entity.
ignore_passable - ignores all passable blocks and entities.
ignore_passents - ignores passable model and sprite entities.
ignore_maps - ignores all map entities.
ignore_models - ignores all models.
ignore_sprites - ignores all sprites.
ignore_push - ignores all entities with lower push values than my.
use_box - uses the bounding box (MIN_X, MAX_X etc.) or the hull of the my entity (see below).
activate_shoot - enables event_shoot triggering of the hit entity.
activate_sonar - enables event_sonar triggering of the hit entity.
scan_texture - sets tex_name and other parameters from the target surface (see below).

ignore_passent ignores model and sprite entities with set passable flag, but still detects passable blocks or map entities. It sets the predefined flags in_passable, when the starting point is inside a passable block or passable block in front of hit target, and on_passable when the hit target is a passable block. It can be used, for example, to detect water below an entity.

Scan_texture can be used to give actors some kind of vision, by retrieving the texture name and the brightness of the hit surface. This mode does only work if use_box is inactive. After the instruction, the predefined string tex_name gives the texture name of the surface hit by the ray, or the entity file name if a model, sprite, or terrain was hit. The predefined flags tex_flag1..tex_flag8 reflect the Flag1..Flag8 states of the texture, that can be set through WED. The variable tex_light gives the shadow map brightness (0..255) at the hit position in the level, tex_fog gives the fog / albedo value. The texture name can be used to check the kind of floor below an entity. Through the str_cmpi instruction the floor texture name can be determined, and some different walking behavior can be set. Another possibility is to make make a player invisible for his enemies while he hides in the shadows. If nothing was hit, tex_name and the other parameters are not set.

Use_box traces not a line, but a 'thick' ray with the size of the my entities' bounding box for collisions with sprite or model entities, and of it's fat or narrow hull for collisions with the level or with map entities. The result delivered back gives the distance from the hit point to the nearest plane of the bounding box in that case. For the collision detection to work, the box or hull must be outside the target. A vertical trace with use_box is used by the template scripts for detecting the distance to the ground, keeping the entities' feet on the floor. Small holes or grates will appear filled out for use_box.


درواقع استفاده از پارامتر هایی که با کلمه ignore شروع میشوند در متغیر از پیش تعریف شدهء TRACE_MODE ، تعیین میکند که بازیگر (player) از دیوار ، اشیاء و ... عبور کند یا خیر .
به عنوان مثال پارامتر ignore_models به معنای عبور نکردن بازیگر از مدل های MDL است و یا ignore_sprites با معنای عبور نکردن بازیگر از اشیاء اسپیرایت است . کاربرد آنها هم مثل نمونه زیر است :
كد:

trace_mode=ignore_models,ignore_sprites;


نمونه کد زیر بسیار کامل تر و بهتر است :
كد:

// test the floor texturevec_set(temp, my.x);
temp.z -= 500; // trace downwards 500 quants below
trace_mode = IGNORE_ME + IGNORE_PASSABLE + IGNORE_MODELS + IGNORE_SPRITES +    scan_texture;
trace (my.x, temp); // now TEX_NAME is set to the floor name below the MY entity
// look if the YOU enemy can be shot at from my position, and if yes, hurt him
trace_mode = IGNORE_ME + IGNORE_PASSABLE + ACTIVATE_SHOOT;
trace (my.x, your.x); // if entity YOU was visible from MY position, its SHOOT event was triggered    


موفق باشی : ستاره Surprised Surprised Surprised
ارسال  بازگشت به بالا
 

نويسنده
پيغام
jonathan
مدیر انجمن
مدیر انجمن


تاريخ عضويت: جمعه 8 ارديبهشت 1385
تعداد ارسالها: 1166
محل سكونت: شيراز


5 شنبه 25 خرداد 1385 - 07:36
پاسخ بصورت نقل قول
ممنون pacificsys.net جان......من هم از اين كدها استفاده كردم......ولي نميدونم چرا موقعي كه لول رو ران كردم دوربين از اجسام رد ميشد شايد من جايي از كار اشتباه كردم اگر كمكم كني ممنون ميشم

_________________
Then you came right in
tearing out my soul
tearing out my soul
tearing out my soul
tearing out my soul
tearing out my soul
ارسال  بازگشت به بالا
ديدن مشخصات كاربر ارسال پيغام خصوصي
 

نمايش نامه هاي ارسال شده قبلي:   
ارسال يك موضوع جديد   پاسخ به يك موضوع    صفحه 2 از 2 تمام ساعات و تاريخها بر حسب 3.5+ ساعت گرينويچ مي باشد
برو به صفحه قبلي  1, 2


 
پرش به:  


شما نمي توانيد در اين انجمن نامه ارسال كنيد.
شما نمي توانيد به موضوعات اين انجمن پاسخ دهيد
شما نمي توانيد نامه هاي ارسالي خود را در اين انجمن ويرايش كنيد
شما نمي توانيد نامه هاي ارسالي خود را در اين انجمن حذف كنيد
شما نمي توانيد در نظر سنجي هاي اين انجمن شركت كنيد


unity3d

بازگردانی به فارسی : علی کسایی @ توسعه مجازی کادوس 2004-2011
Powered by phpBB © 2001, 2011 phpBB Group
| Home | عضويت | ليست اعضا | گروه هاي كاربران | جستجو | راهنماي اين انجمن | Log In |