<commit_before>/*
    Copyright (C) 2000 by <NAME>
  
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
  
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
  
    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __CS_CAMPOS_H__
#define __CS_CAMPOS_H__

#include "csobject/csobject.h"
#include "csobject/pobject.h"
#include "csobject/nobjvec.h"
#include "csgeom/vector3.h"
#include "csengine/camera.h"
#include "iengine/campos.h"

class csEngine;

/**
 * Camera position structure. This structure is used internally by the
 * engine to store named camera positions than can be retrieved by
 * client programs to store starting map points, teleporter positions
 * and so on. In the map file you can use CAMERA (...) keyword to
 * define such points.
 */
class csCameraPosition : public csPObject
{
public:
  /// The sector this camera points to
  char *Sector;
  /// The camera position
  csVector3 Position;
  /// Camera orientation: forward vector
  csVector3 Forward;
  /// Camera orientation: upward vector
  csVector3 Upward;

  /// Initialize the camera position object
  csCameraPosition (const char *iName, const char *iSector,
    const csVector3 &iPosition,
    const csVector3 &iForward, const csVector3 &iUpward);

  /// Destroy this object and free all associated memory
  virtual ~csCameraPosition ();

  /// Change camera position object
  void Set (const char *iSector, const csVector3 &iPosition,
    const csVector3 &iForward, const csVector3 &iUpward);

  /// Load the camera position into a camera object
  bool Load (csCamera&, csEngine*);

  CSOBJTYPE;
  DECLARE_OBJECT_INTERFACE;
  DECLARE_IBASE;

  //--------------------- iCameraPosition implementation ----------------------
  struct CameraPosition : public iCameraPosition
  {
    DECLARE_EMBEDDED_IBASE(csCameraPosition);

    virtual iObject *QueryObject() {return scfParent;}
	
	virtual char *GetSector() { return scfParent->Sector; }

	virtual csVector3 GetPosition() { return scfParent->Position; }<commit_msg>Fix compile error by adding missing "const" from GetSector.<commit_after>/*
    Copyright (C) 2000 by <NAME>
  
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
  
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
  
    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __CS_CAMPOS_H__
#define __CS_CAMPOS_H__

#include "csobject/csobject.h"
#include "csobject/pobject.h"
#include "csobject/nobjvec.h"
#include "csgeom/vector3.h"
#include "csengine/camera.h"
#include "iengine/campos.h"

class csEngine;

/**
 * Camera position structure. This structure is used internally by the
 * engine to store named camera positions than can be retrieved by
 * client programs to store starting map points, teleporter positions
 * and so on. In the map file you can use CAMERA (...) keyword to
 * define such points.
 */
class csCameraPosition : public csPObject
{
public:
  /// The sector this camera points to
  char *Sector;
  /// The camera position
  csVector3 Position;
  /// Camera orientation: forward vector
  csVector3 Forward;
  /// Camera orientation: upward vector
  csVector3 Upward;

  /// Initialize the camera position object
  csCameraPosition (const char *iName, const char *iSector,
    const csVector3 &iPosition,
    const csVector3 &iForward, const csVector3 &iUpward);

  /// Destroy this object and free all associated memory
  virtual ~csCameraPosition ();

  /// Change camera position object
  void Set (const char *iSector, const csVector3 &iPosition,
    const csVector3 &iForward, const csVector3 &iUpward);

  /// Load the camera position into a camera object
  bool Load (csCamera&, csEngine*);

  CSOBJTYPE;
  DECLARE_OBJECT_INTERFACE;
  DECLARE_IBASE;

  //--------------------- iCameraPosition implementation ----------------------
  struct CameraPosition : public iCameraPosition
  {
    DECLARE_EMBEDDED_IBASE(csCameraPosition);

    virtual iObject *QueryObject() {return scfParent;}
	
	virtual const char *GetSector() { return scfParent->Sector; }

	virtual csVector3 GetPosition() { return scfParent->Position; }
{'fraction_non_alphanumeric': 0.08627978478093774, 'fraction_numerical': 0.009223674096848577, 'mean_word_length': 3.522154648132059, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2067881', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1415, 'n_words': 609}