请选择 进入手机版 | 继续访问电脑版
设为首页收藏本站

ESFKAMI

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

ESFX

ESF: Xenoverse

ESF123

ESF1.2.3

EVM2.1

EVM2.1

ECXSSJ

ECX: TeamSSJ

ECX2.2

ECX RC2

ECX2.3

ECX RC3

查看: 2499|回复: 0

[HLSDK/AMXX]设置摄像机角度和坐标|Set Cam Angles and Origin

[复制链接]

212

主题

217

帖子

1221

积分

ESFKAMI

Rank: 8Rank: 8

积分
1221
发表于 2017-7-29 10:43:28 | 显示全部楼层 |阅读模式
ClientSide Version:
Hook "V_CalcRefdef" and set ang/org after Callback

  1. void V_CalcRefdef(struct ref_params_s *pparams)
  2. {        
  3.         gExportfuncs.V_CalcRefdef(pparams);// Function Callback

  4.         pparams->vieworg[0] = 0.0;// Origin
  5.         pparams->vieworg[1] = 0.0;
  6.         pparams->vieworg[2] = 0.0;

  7.         pparams->viewangles[0] = 0.0;// Angles
  8.         pparams->viewangles[1] = 0.0;
  9.         pparams->viewangles[2] = 0.0;
  10. }
复制代码
ServerSide Version:
Create a new entity.
Use "attach_view" to set the player's view to the new entity.
And set the new Ang/Org for the new entity with pev_origin/pev_v_angle

  1. #include < amxx/amxmodx >
  2. #include < amxx/engine >
  3. #include < amxx/fakemeta >

  4. public plugin_init() register_message( get_user_msgid( "InitHUDMap" ), "@V_CalcRefdef" );

  5. @V_CalcRefdef( MsgID, dest, Client )
  6. {
  7.         new SubCamera = create_entity( "info_target" );

  8.         attach_view( Client, SubCamera );

  9.         set_pev( SubCamera, pev_classname, "SubCamera" );
  10.         set_pev( SubCamera, pev_origin, { 0.0, 0.0, 0.0 } );
  11.         set_pev( SubCamera, pev_v_angle, { 0.0, 0.0, 0.0 } );
  12. }
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|ESFKAMI    

GMT+8, 2018-10-17 22:57 , Processed in 0.273355 second(s), 21 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表